Commit Graph
110 Commits
Author SHA1 Message Date
Marius Van Nieuwenhuyse 2470f8d970 feat(android): Added originalDateTime to exif handling 2026-07-27 20:37:01 +02:00
ALandAlister Stevens dd39592faf fix(android): Prevent out of memory errors on Android when selecting large media (video) files from the gallery picker. (#923)
Changes from #906 resulted in all gallery picker results being read in full into a byte array. This works fine when dealing with images, however when larger files (videos for example) are selected it will nearly always result in an out of memory error (reading too much data in one go). With videos no transformation is required, the URI simply need to be returned.

Co-authored-by: Alister Stevens <alister@pebblepad.co.uk>
2026-04-20 18:19:26 +02:00
エリス 571f1169fd chore(license): update header formatting (#958) 2026-03-24 13:52:15 +09:00
Manuel Beck dc682b2532 feat(ios): use PHPickerViewController for iOS 14+ (#937)
- 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
2026-01-13 08:33:59 +01:00
Norman Breau 8864262022 fix(android): Error propagation when no Camera application is available (#926) 2025-03-20 16:13:02 -03:00
Norman Breau 48c4cdd47f refactor(android): Make WRITE_EXTERNAL_STORAGE optional (#909)
* 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
2024-10-28 15:21:37 -03:00
Norman Breau c208754c08 refactor(android): remove query img usage (#907)
* refactor: remove unnecessary duplicate image checks and queryImgDb usage

* remove unused imageType parameter, because it's a private API anyway
2024-10-28 13:32:35 -03:00
Norman Breau 0d86764b90 refactor(android): replace image path usage with image uris (#906)
* refactor(android): clean up image file path usages

* removed references of image paths in log messages
2024-10-28 12:35:50 -03:00
Norman Breau 2eaa9a3972 fix: return content uris when possible when selecting from gallery (#902) 2024-10-26 00:58:24 -03:00
Norman Breau a672c31efb fix(android): Return data uris as an URI (#910) 2024-10-26 00:58:00 -03:00
Norman Breau 16325102c7 fix(android): Improper serialization of image uri in save instance state (#903) 2024-10-25 13:59:29 -03:00
Norman Breau 36bf8e7331 fix(android): improper cache path construction during image manipulation (#905) 2024-10-25 13:15:59 -03:00
Norman Breau feb7643bc3 fix(android): Use VERSION_CODES instead of hard-coded API literals (#904) 2024-10-25 13:10:05 -03:00
Norman Breau 44480300d9 fix(android): Isolate provider access to a subdirectory (#901) 2024-10-25 13:09:03 -03:00
ravi-ykandRavi Yakasiri faa4615ee0 Remove media permissions to make complaint with Android 14 requirements (#889)
Co-authored-by: Ravi Yakasiri <ravi.yakasiri@planonsoftware.com>
2024-10-24 13:38:18 -03:00
エリスandochakov 505ccefb4c feat(android)!: Android 13 support (#844)
* 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>
2023-08-26 20:21:32 +09:00
Norman Breau 84166f6355 chore(android): Cleanup obsolete BuildConfig comments (#831) 2023-04-14 08:48:12 -03:00
seamlink-aalvesandAlexandre Alves 2c09ade500 fix(android): set applicationId (#827)
Co-authored-by: Alexandre Alves <aalves@seamlink.com>
2023-04-14 08:06:30 -03:00
e9db20e381 fix(android): return exception message (where it exists) (#687)
Co-authored-by: エリス <erisu@users.noreply.github.com>
Co-authored-by: jcesarmobile <jcesarmobile@gmail.com>
2021-08-11 16:56:42 +09:00
c7971d9f63 fix(android): file path correction if Uri authority is FileProvider (#585)
Co-authored-by: Tim Brust <ratchet.player@gmx.de>
Co-authored-by: Francis Monier <contactpro@francismonier.com>
Co-authored-by: Norman Breau <norman@normanbreau.com>
2021-08-11 16:34:20 +09:00
エリス 0227cdcf14 feat(android)!: support AndroidX (#751)
* feat: migrate FileProvider to androidx
* feat: add androidx.core:core with variable override ANDROIDX_CORE_VERSION
2021-08-09 23:09:29 +09:00
Pieter Van Poyer 75bf807261 Bugfix issue 711 heic format (#731)
* Android - issue/711 - support .heic format
2021-08-09 15:36:58 +02:00
Pieter Van PoyerandTim Brust f704689200 Bugfix issue 665 (#700)
* 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>
2021-02-02 14:43:26 -04:00
エリス 8975171d7a chore(android): add missing apache license header (#686) 2020-11-04 10:12:19 +09:00
Pieter Van Poyer ebe0517a24 Bugfix issue 341 save to photo gallery - Fixes #341, fixes #577 (#669)
* 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
2020-10-16 23:48:22 -03:00
jcesarmobile 0333d001c7 breaking: remove NATIVE_URI DestinationType (#637) 2020-08-07 14:38:05 +02:00
jcesarmobile e2ecd7fe91 fix(android): return error if file url is null (#632) 2020-07-23 12:11:55 +02:00
Loïc Le Malliaudandjcesarmobile eb7fc333ee fix(android): use provider prefix to avoid conflicts other plugin providers (#510)
Co-authored-by: jcesarmobile <jcesarmobile@gmail.com>
2020-07-16 13:08:40 +02:00
jcesarmobile fd155d9705 breaking(android): stop using CordovaUri helper class (#617) 2020-07-14 16:26:09 +02:00
Jesse MacFadyen df14414203 Cache images in device storage, devices have enough space now. 2020-04-28 13:57:00 -07:00
Hazem Saleh 295e928784 (Android) Fix NullPointerException error on some Android phones (#429) 2019-05-05 19:16:20 +02:00
Hazem Saleh a13665d530 AAR-232: (android) Enhancement: Camera plugin code cleanup (#425) 2019-03-01 14:00:39 -05:00
Álvaro Herrero 81b878da59 GH-329: (android) Fixes issue: Exif data lost on many cases (#331)
* GH-329 android: Fix Exif data lost when correctOrientation is true

* Changed variable name
2019-02-21 16:51:54 +01:00
jcesarmobile 60e779559e Android: return DATA_URL for ALLMEDIA if it's an image (#382) 2018-12-09 12:39:06 +01:00
bvmensvoort 5c23b65af9 CB-14097: (android) Fix crash when selecting some files with getPicture (#322)
* CB-14097: (android) Fix crash when selecting some files with getPicture of urls with raw://

Handles both urls:
content://com.android.providers.downloads.documents/document/1111
content://com.android.providers.downloads.documents/document/raw%3A%2Fstorage%2Femulated%2F0%2FDownload%2Ffilename.pdf

* Optimization: Remove TextUtils dependency, return null when no id could be extracted
2018-07-06 00:16:25 +02:00
Hazem Saleh 5ec121bf98 CB-14047: (android) CameraLauncher: Replacing Repeated String literals with final variables (#319) 2018-04-22 14:33:52 -04:00
Joe Bowser c8581ba2c9 Merge pull request #275 from cjpearson/CB12953
CB-12593: (android) Fix potential FileProvider conflicts
2018-03-14 12:44:35 -07:00
Alpesh Patel bf935dfbd2 CB-13415 (android) Importing corrupt images using the Camera plugin c… (#309)
* CB-13415 (android) Importing corrupt images using the Camera plugin crashes the app
2018-02-08 13:12:16 +01:00
rpanadero 36ea63a60f CB-13781: (android) Fixed permissions request on Android 8 to save a photo into the photo album 2018-01-15 13:05:10 +01:00
José Luis Ballesteros del Val 3b8f64e330 CB-12964: (android) Fix of bug when Pictures folder did not exist.
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
2017-07-04 14:03:10 +03:00
Connor Pearson cfefa53272 CB-12593: (android) Fix potential FileProvider conflicts 2017-06-30 10:15:43 -04:00
Sergii Stotskyi c3d7e55ad4 CB-12682: (ios, android): changes cancel error message to be consistent for ios android 2017-06-07 07:36:30 +03:00
Joe Bowser bba8283d98 CB-12005: Changing the getOrientation method to return the defined enumerated EXIF instead of orientation in degrees for Consistency
This closes #252
2017-02-02 12:10:42 -08:00
Sergey Zolotarev d29c767f07 CB-12368: Fix permission check on Android
The plugin was checking whether camera permission was granted but then
actually requested permission for external storage.

Surprisingly enough this fixed CB-12368.
2017-01-30 23:52:54 +01:00
Shazron Abdullah 8b83171ee2 Fix missing license headers. 2016-12-07 16:19:39 -08:00
Joe Bowser 84f96c1067 CB-11625: Files Provider does not work with Android 4.4.4 or lower, and I have no idea why. Working around with CordovaUri 2016-10-27 13:37:03 -07:00
Joe Bowser 61064ae3ed CB-11625 (Android) : Make this work with previous versions of Cordova via cordova-plugin-compat 2016-10-21 15:12:34 -07:00
Joe Bowser b63a0d83e0 Merging API 24 code with master including large refactor 2016-09-01 15:11:33 -07:00
swbradshaw f8682b9162 Removed unneeded file
This closes #197
2016-08-29 10:46:14 -07:00
swbradshaw 0ed6406864 Merge remote-tracking branch 'refs/remotes/apache/master'
Rebase from Master
2016-08-26 20:30:35 -04:00