Closed timostuebing closed 7 years ago
Hi @timogroeger, Thank you for the given description for the problem. Regarding that could you provide some more info about the project and how you attached the Image source for the ImageView component. It would be really helpful if you could send us sample project, which demonstrates the issue and could be debugged locally on our side.
In the meantime, I would suggest to review the sample project here and to verify, whether you will have the same problem while building it on your device. Something more, you could also try to attach directly the imageAsset for the ImageView source instead of on converting it to a base64 string and to validate if the rotation and the OutOfMemory problem still exists. Similar to the example.
Also, keep in mind that toBase64String method does not work properly at this time. This is already logged here. Workaround about this could be found here.
closing due to inactivity
Please, provide the details below
camera-plugin ignores image-rotation after some pictures and then, when taking more images, makes the app crash with a memory error.
Did you verify this is a real problem by searching [Stack Overflow]
Yes.
Tell us about the problem
I have a view that takes pictures for being saved as part of a note.
In the beginnung, on my Samsung Galaxy S4, the images taken are rotated correctly. But after two or three pictures or so, it starts to ignore the orientation which results in portrait pictures being rotated by 90° CW. After that, all subsequent pictures are not rotated anymore.
Worse, this seems to go along with a memory leak, because after some more (incorrectly rotated) pictures the app crashes with
Other fellows had similar problems with the Cordova Camera Plugin. Unfortunately their solution relies on a setting called
AllowEdit
which nativescript-camera does not have. https://forum.ionicframework.com/t/camera-wrong-orientation-with-android/8583/25I went into the
nativescript-camera.android.js
and put some logging there to eventually find the memory leak. What I found is the following behaviour:First picture
Second picture (still correct, but look at the double call)
Third picture
Fourth picture
This behaviour stacks until the app dies with an OutOfMemory Error – the full stacktrace is shown below.
modified nativescripe-camera.android.js
The snippet calling the camera plugin
Which platform(s) does your issue occur on?
Android 5.0.1 on Samsung Galaxy S4
Please provide the following version numbers that your issue occurs with
"dependencies": { "@ angular/animations": "4.0.1", "@ angular/common": "4.0.1", "@ angular/compiler": "4.0.1", "@ angular/core": "4.0.1", "@ angular/forms": "4.0.1", "@ angular/http": "4.0.1", "@ angular/platform-browser": "4.0.1", "@ angular/platform-browser-dynamic": "4.0.1", "@ angular/router": "4.0.1", "@ angular/upgrade": "4.0.1", "base-64": "^0.1.0", "moment": "^2.18.1", "nativescript-10hook-release-info": "^1.0.0", "nativescript-angular": "~3.1.0", "nativescript-badge-button": "^0.1.1", "nativescript-camera": "^3.1.2", "nativescript-cardview": "^2.0.2", "nativescript-couchbase": "^1.0.18", "nativescript-drop-down": "^3.1.0", "nativescript-floatingactionbutton": "^3.0.1", "nativescript-hockey-sdk": "^1.2.0", "nativescript-hook": "^0.2.1", "nativescript-i18n": "^0.2.2", "nativescript-ibeacon": "0.8.1", "nativescript-imagepicker": "^3.0.4", "nativescript-iqkeyboardmanager": "^1.1.0", "nativescript-loading-indicator": "^2.3.2", "nativescript-local-notifications": "^1.2.1", "nativescript-ngx-fonticon": "^2.2.0", "nativescript-pulltorefresh": "^2.0.2", "nativescript-push-notifications": "^0.1.3", "nativescript-ripple": "^2.0.0", "nativescript-sidedrawer": "^1.0.6", "nativescript-snackbar": "^1.1.7", "nativescript-statusbar": "^3.0.1", "nativescript-telerik-ui": "3.0.4", "nativescript-theme-core": "~1.0.2", "nativescript-unit-test-runner": "^0.3.4", "nativescript-web-image-cache": "^4.1.0", "reflect-metadata": "~0.1.8", "rxjs": "~5.3.0", "tns-core-modules": "^3.1.0", "utf8": "^2.1.2", "zone.js": "~0.8.5" }
"tns-android": { "version": "3.1.1" }
node version v6.11.1
I'd be happy to hear from you on this one, guys!