- Does not need any permissions for reading images
- The PHPickerViewController class is an alternative to UIImagePickerController. PHPickerViewController improves stability and reliability, and includes several benefits to developers and users, such as the following:
- Deferred image loading and recovery UI
- Reliable handling of large and complex assets, like RAW and panoramic images
- User-selectable assets that aren’t available for UIImagePickerController
- Configuration of the picker to display only Live Photos
- Availability of PHLivePhoto objects without library access
- Stricter validations against invalid inputs
- See documentation of PHPickerViewController: https://developer.apple.com/documentation/photosui/phpickerviewcontroller?language=objc
- Added tests for PHPickerViewController in `CameraTest.m`
* Documentation and formatting
- Document `takePicture` and `showCameraPicker` in `CDVCamera.m`
- A pragmas for UIImagePickerControllerDelegate methods and CLLocationManager methods
- Format some long methods declarations to multi-line instead single-line for better readability
- Remove unnecessry `dispatch_async(dispatch_get_main_queue() ...` in `takePicture` before calling `showCameraPicker`. This is already done in `showCameraPicker`.
- Source out code for permission denied alert dialog when accessing the camera or UIImagePickerController on iOS < 14 for picking images
* feat(ios): proper formatting of methods
- Use linux brace style: A brace have to be on a new line for method declarations
- Remove unnecessary whitespaces in method declrations
* doc: readme update
- Better document usage descriptions
- `NSPhotoLibraryUsageDescription` not needed for iOS 14+ when only picking images
- Improve formatting for xml, js
- sourceType `SAVEDPHOTOALBUM` is the same as `PHOTOLIBRARY` on Android and iOS 14+
- Use `PHOTOLIBRARY` as sourceType instead of `SAVEDPHOTOALBUM` in photo picker example
* Android: Document `SAVEDPHOTOALBUM``
- Make clear that `SAVEDPHOTOALBUM` is the same like `PHOTOLIBRARY` and has only an effect on iOS < 14
- Format code when creating image chooser and document the request code parameter
* refactor(android): Rework permission management to make WRITE_EXTERNAL_STORAGE optional
* removed unused getPermissions API
* Proper error if WRITE_EXTERNAL_STORAGE is required but missing the declaration
* removed obsolete hasPermissions API
* feat(android)!: Android 13 support
* refactor(android): simplify getPermissions logic
* feat(android)!: bump cordova-android requirement to >=12.0.0
* feat(android): update saveAlbumPermission to include Android 9 and below use case
---------
Co-authored-by: ochakov <evgeny@ochakov.com>
* GH-665 - store the imageFilePath when the app is paused (onSaveInstance) and restore it back.
* Update src/android/CameraLauncher.java whitespace layout
Co-authored-by: Tim Brust <github@timbrust.de>
Co-authored-by: Tim Brust <github@timbrust.de>
* GH-341 - GH-577 Fixed the Save Photo To Album starting from camera - Android
- saveToPhotoAlbum feature fixed by taken into count content - uri. (writeUncompressedImage method) ( see: https://github.com/apache/cordova-plugin-camera/issues/611#issuecomment-700273405 )
- make saveToPhotoAlbum future proof by using the MediaStore to insert the taken image
- made a method to calculate the compressFormat based on the encodingType (JPEG or PNG)
- layout of the performCrop method is adjusted
- removed unused rotate variable inside processResultFromGallery method
* Add extra VO class to the plugin.xml
* added package declaration to new VO
* GH-341 - GH-577 https://github.com/apache/cordova-plugin-camera/pull/669#discussion_r504632953 listen to review
If someone had removed Pictures folder in android, plugin failed trying to move there the new photo. This happened because plugin did not check the existence of this folder, and if not, it did not complete the folder tree.
This closes#273
The plugin was checking whether camera permission was granted but then
actually requested permission for external storage.
Surprisingly enough this fixed CB-12368.
Default value is set to 80 on the java code, but doc says that default
value is 50.
I’m changing it just for making code clearer, but default value is set
to 50 to all platforms in Camera.js if no value is passed
The only way to get rotation for photos in library (Gallery, File
System, Google Drive,etc) is to first create a temporary file from the
provider. Only then can we determine the orientation and scale the
bitmap correctly. By doing it in a central place, it eliminates reading
the inputstream repetitively in the plugin.