Skip to content
This repository has been archived by the owner on Oct 22, 2023. It is now read-only.

brianmwadime/phonegap_edge_camera

Repository files navigation

title description
EdgeCamera
Take pictures with the device camera and automatically crop them.

Based of IPDFCameraViewController

phonegap_edge_camera

This plugin defines a global EdgeCamera object, which provides an API for taking pictures and cropping them.

Installation

This requires cordova 5.0+

Currently installable via repo url directly ( unstable )

cordova plugin add https://github.com/brianmwadime/phonegap_edge_camera.git

API Reference


edgecamera

camera.getPicture(successCallback, errorCallback, options)

Takes a photo using the camera, or retrieves a photo from the device's image gallery. The image is passed to the success callback as a Base64-encoded String, or as the URI for the image file.

The camera.takePicture function opens the device's default camera application that allows users to snap pictures by default. Once the user snaps the photo, it is cropped and the camera application closes and the application is restored.

The return value is sent to the cameraSuccess callback function, in one of the following formats, depending on the specified cameraOptions:

  • A String containing the Base64-encoded photo image.

You can do whatever you want with the encoded image or URI, for example:

  • Render the image in an <img> tag, as in the example below

  • Save the data locally (LocalStorage, Lawnchair, etc.)

  • Post the data to a remote server

Supported Platforms

  • iOS

Kind: static method of edgecamera

Param Type Description
successCallback onSuccess
errorCallback onError
options CameraOptions CameraOptions

Example

EdgeCamera.takePicture(cameraSuccess, cameraError, cameraOptions);

About

Cordova document cropping plugin for iOS

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published