96 Commits

Author SHA1 Message Date
Oscar Franco
a4ad0446ca
Merge pull request #972 from MassiveMediaMatch/master
Fix for: Fast swiping and touching while loading crashes the app
2018-01-12 20:30:03 +01:00
Oscar Franco
cde5493870 [BUGFIX] Fix crash on empty mFaceDetector instance when face is not recognized 2018-01-09 12:56:58 +01:00
Sibelius Seraphini
cebc2268a6
Merge pull request #904 from leepa/master
Disallow capture when Camera is null (Android)
2018-01-08 12:56:10 -08:00
Marcus Andersson
e546ae852c fixed merge conflicts. 2018-01-08 21:12:39 +01:00
Sibelius Seraphini
eb6a250ced fix rename issue 2018-01-03 09:47:10 -02:00
Sibelius Seraphini
a0817132d6 rename expo to simple RN, add js files, and export them inside the same camera package 2018-01-01 19:16:02 -02:00
Sibelius Seraphini
ffc74e5e6e Add Camera implementation using CameraView on Android
This is most a copy of expo camera module

this still half baked, missing javascript part and package and modules
fixes

see #246
2017-12-31 13:49:39 -02:00
Marcus Andersson
93177c8604 changed so we use the correct exceptions. 2017-12-20 20:25:01 +01:00
Marcus Andersson
c51f0b5f93 fixed so android cropping works in all orientations. 2017-12-20 20:19:14 +01:00
Marcus Andersson
ed2768828b fixed some formatting issues. 2017-12-20 20:19:14 +01:00
Marcus Andersson
c323105328 added switch to toggle cropping. 2017-12-19 15:04:41 +01:00
Marcus Andersson
c6ad435532 added support for android to crop image to preview. 2017-12-19 15:03:08 +01:00
Slavik
874a29f7cb (barcode): Fix scan on landscape mode (#949)
* add scan support for landscape mode

* refactoring

* fix errors

* fix rotation

* add landscape orientation support

* fix exception

* freeze preview image

From PR https://github.com/lwansbrough/react-native-camera/pull/919
2017-12-07 12:17:02 -08:00
Sibelius Seraphini
241b5d1060
Merge pull request #859 from cbrevik/start-stop-preview
Add start/stopPreview for Camera
2017-12-07 10:48:23 -02:00
Petter Solberg
e11ed2fb52 Fixed hardcoded jpegQuality on android when saving to temp and disk 2017-11-08 17:15:48 +01:00
Lowie Huyghe
ca48b33f7f Fix for: Fast swiping and touching while component is being loaded can cause _camera to be null. 2017-11-07 17:02:48 +01:00
Lee Packham
780a6c70c9 Disallow capture when Camera is null (Android)
If a user of the library called `capture` too early then it tries to get
the device orientation from the RCTCamera instance... which doesn't yet
exist.

Instead of adding anything clever in the library, just call
promise.reject() so that the host application can decide what to do with
this issue (probably wait, retry in a bit).

This mainly effects slower Android devices where the camera can take a
long time to initialize.
2017-09-23 23:17:54 +01:00
gabrielSchaidhauer
537b7696b4 (android): Missing ; on constructor (#880)
On the RCTCameraModule is missing a ';' causing a build failure.
2017-09-08 13:26:53 -07:00
Andy Li
618f5ec92f [captureWithOrientation()] Load shutter_click sound to reduce latency while playing during capture (#871) 2017-09-08 22:03:35 +02:00
Christian Brevik
4e04e3484b
Make safer calls on Android 2017-08-29 14:35:35 +02:00
Christian Brevik
1bcf8577a4
Add start/stopPreview for Camera 2017-08-27 18:08:58 +02:00
Guy Blank
e3fc27711c (barcode): Fix for missing bounds in Android #683 (#845) 2017-08-19 15:19:18 -07:00
Radek Czemerys
02eb51d962 Remove createJSModules @override marker - RN 0.47 compatibility (#821)
* Remove depreciated createJSModules @ovveride marker

* Added comment

* Fix typo in comment

* Fix typo in comment
2017-08-07 12:52:31 -07:00
Max Findel
1135c53f7f Fix NullPointerException on MutableImage when taking a picture (#816) 2017-08-01 06:26:56 -07:00
Nick Pomfret
7f69acdad1 when saving images, only invoke the media scanner if the user is saving to the camera roll. (#716) 2017-06-13 18:01:34 -07:00
Symous
71098d4ed5 Fix torch init status (#709)
fix call the setTorchMode (which was calling flash erroneously)
2017-05-23 19:47:23 +01:00
Nick Pomfret
cb4447c60e add fixOrientation option (#682)
* optional fix orientation

* comments

* docs
2017-05-17 10:32:53 -07:00
Nick Pomfret
d54eae9ea5 Merge pull request #674 from just-football/master
[Fix] Image orientation bug when mirroring set to true
2017-04-26 09:44:57 +01:00
Abe Botros
ae9eab3533 (android): Android tap-to-focus and improved (continuous) auto-focus (#575)
* Android tap-to-focus and improved (continuous) auto-focus

Tap-to-focus

- On tap, compute focus area around motion event's location, and pass this to the camera parameters
  as the new focus area.
- Adds RCTCameraUtils.java file, so far with only a single function that helps compute the focus area
  from a motion event. This file can serve as a location for utility constants and functions for the
  rest of the app, where such things can be extracted out.

Improved (continuous) auto-focus

- Use FOCUS_MODE_CONTINUOUS_PICTURE/VIDEO when possible to enable continuous auto-focus; fall back to
  FOCUS_MODE_AUTO otherwise, if able.

Other changes

- Update README to specify differences between iOS and Android for focus and zoom functionality.
- Update AndroidManifest with more thorough list of permissions and features.
- Update Example package.json react and react-native dependencies to match root package's package.json.

* Example: default empty onFocusChanged callback

- Enables default tap-to-focus behavior in Example app, facilitating
  testing of focus features in the Example app
2017-04-24 09:25:49 -07:00
Joshua Pinter
e187b8a0e7 (android): Update compileSdkVersion to 25 and buildToolsVersion to 25.0.2 (#677)
* Update compileSdkVersion to 25 and buildToolsVersion to 25.0.2

Best to keep these up-to-date. Doesn't affect backwards compatibility.

* Add buildToolsVersion requirement of 25.0.2.
2017-04-23 12:38:42 -07:00
Rikard Franksson
8bccc77f65 Update RCTCameraModule.java 2017-04-21 13:44:43 +02:00
Nick Pomfret
5c54275aec android jpeg compression support (#658)
*  * removed some of the re-parsing of the output image byte array
 * removed re-saving of output file
 * moved image processing onto an async task to allow camera to be used while processing is running

* added jpeg compression support for android

* move explanation to correct bit of docs
2017-04-06 08:28:47 +02:00
Deividy Metheler
5097f95c6f android; wrap call to _camera.autoFocus into try/catch 2017-04-06 08:27:50 +02:00
Tomas Roos
4d2dcf74a5 Merge pull request #615 from NazarYablonskiy/master
Small, but important changes
2017-03-29 16:30:36 +02:00
Nick Pomfret
9fd9d1f8b1 (android): android performance improvements (#644)
* removed re-saving of output file
 * moved image processing onto an async task to allow camera to be used while processing is running
2017-03-24 00:00:56 -07:00
Nick Pomfret
98de15cf9a [android] add gps meta to android (#643)
* writing metadata.location (lat and lon coords only) to the exif data... and returning the internal url for the new image (which can be used in conjunction with the RN CameraRoll)

* just a tidy up to remove some duplication and fix some logging (no functional changes)

* oops, fix typo

* docs

* added mediaUri to ios so its the same as android
2017-03-23 08:41:01 -07:00
Nazar Yablonskiy
b35f8fc3cb removed some uses-permission 2017-02-27 21:25:18 +02:00
Derek Hsu
c12fd726a3 Fix barcode type ‘code128’ typo (#563) 2017-01-22 23:20:39 -08:00
Rob Stemen
12afd8443a Fixed issue where Android camera would crash the application if the user attempted to capture too many pictures in a short timeframe. (#553) 2017-01-22 19:33:17 -08:00
Nathan Ward
f301331b15 [Android): fixes crashes related to orientation (#537) 2017-01-02 13:27:07 -08:00
Nicolas Charpentier
76963a0a5e Revert "Add video/audio authorization check for Android" (#516) 2016-12-14 17:18:15 -05:00
Üstün Ergenoglu
877ce2e6b2 Add video/audio authorization check for Android (#513)
* Add video/audio authorization check for Android

This only checks for the permission and no request is made. `PermissionAndroid` in recent React Native or manually asking it from native code can still be used.

* Add checkDeviceAuthorizationStatus
2016-12-14 09:52:25 -08:00
pkwak-sf
f696610115 Fix issue with updating props quickly causing released camera object to be accessed. (#507) 2016-12-10 08:15:52 -05:00
Ron Heft
b308d08e9a Race conditions initializing flashMode (#436)
* Fix race condition initializing Android camera

* Fix race condition initializing flashMode iOS
2016-12-08 21:05:35 -05:00
Benjamin Toueg
33bd0c4737 Android pinch to zoom (#498)
* Android pinch-to-zoom feature.

* Missing import.
2016-12-05 19:58:17 -05:00
Alexander Pantyuhov
06dc7ac5a7 Image orientation fix (#475, #309) (#493)
fix
2016-12-04 18:32:04 -05:00
Benjamin Toueg
3a20709f64 Minor: Remove duplicate if (#487) 2016-11-26 13:07:07 -05:00
Locly
154cb7aa58 Added Camera.constants.CaptureQuality.preview for android to allow the outputted image to be exactly the same as the previewed image (#449) 2016-11-21 19:41:19 -05:00
abrahambotros
a2a6d028a4 Add 1080p, 720p, and 480p capture qualities. (#469)
* Add 1080p, 720p, and 480p capture qualities.

* Minor improvements for picture/video sizing.

- Minor refactoring for getting supported sizes (DRY).
- Add explicit pictureSize setting for 480p/720p/1080p in still/picture mode.

* Use util.Size objects for 480p/720p/1080p sizing.

- Note using Camera.Size objects would require a camera instance prior to creating the
  size objects, which would be manageable but not too clean.

* Remove 480p for iOS; 16:9/HD aspect ratio for Android 480p

- iOS only has a 640x480 480p-like AVCaptureSessionPreset, which is not the typical 16:9/HD aspect ratio
  desired. Removing this option as a result of this.
- Android 480p updated to use 16:9/HD aspect ratio.

* Add notes for (in)exact sizing for 1080p/720p/480p

* Re-add 480p on iOS, more notes on resolutions.

- Add notes on non-HD-aspect-ratio for iOS 480p.
- Add more explanation of variable resolution/sizes, especially for 480p on Android.

* Use custom Resolution class to hold 480p/720p/1080p resolution sizes

- Mistakenly used util.Size class before, which was not added until Android API level 21 (current
  min is 16).
2016-11-18 17:38:23 -05:00
abrahambotros
b16ec4ab75 Minor Android MediaRecorder, sizing, and file improvements (#477)
Android MediaRecorder:
  - Most importantly, call Camera.unlock() before setting the camera on the
    MediaRecorder instance, and release() not just reset() when releasing the MediaRecorder
    instance!
  - Add comments and notes for preparing and releasing MediaRecorder instance.
  - Add onError callback for errors during recording session.

RCTCameraViewManager, RCTCamera, RCTCameraViewFinder, RCTCameraView:
  - Implement setCaptureMode, preparing camera based on captureMode. Currently, the only step that
    needs to be taken here is setting the recording hint for videos.
  - Handle setting _captureMode instance variable where applicable.

Sizing
  - Determine ViewFinder supported sizes based on actual captureMode (i.e., get supported picture
    sizes when in still capture mode, and get supported video sizes when in video capture mode).

Output files:
  - Get appropriate external storage public directory based on media type (image or video).
  - Minor variable renaming to indicate that both images or videos can be saved.

README:
  - Update captureTarget to indicate that cameraRoll is the actual default for both systems.
  - Small clarification for output data type for deprecated memory captureTarget output.
2016-11-17 22:25:51 -08:00