Git Product home page Git Product logo

Comments (12)

jeduan avatar jeduan commented on July 18, 2024

This is possibly related to the new permission system in marshmallow. If using that, setting the permissions in Android Manifest is not enough. You can try to set those manually in your test device.

Here's the relevant documentation. https://developer.android.com/training/permissions/requesting.html

from cordova-plugin-crop.

matte5031 avatar matte5031 commented on July 18, 2024

Okay so for Android 6.0+ the plugin needs a way to check if permission isn't allowed, and if not, ask for permission? or maybe use another plugin for it like https://www.npmjs.com/package/cordova-plugin-android-permissions i guess?

from cordova-plugin-crop.

akhilesh2310 avatar akhilesh2310 commented on July 18, 2024
[INFO:CONSOLE(1983)] "================= from isValidImage
==================", source:
file:///android_asset/www/js/controllers/appCtrl.js (1983)

07-04 15:20:49.368 12461-12461/com.linkstreet.apps.mlink I/chromium:
[INFO:CONSOLE(1984)] "
https://mlink.linkstreet.in:8001/v1/public/api/media/image/4e592cc0-41cc-11e6-96ad-af08d744f099",
source: file:///android_asset/www/js/controllers/appCtrl.js (1984)

07-04 15:21:04.055 12461-12461/com.linkstreet.apps.mlink I/Timeline:
Timeline: Activity_idle id: android.os.BinderProxy@27a5a9e9 time:200174660

07-04 15:21:04.196 12461-12640/com.linkstreet.apps.mlink I/Timeline:
Timeline: Activity_launch_request id:com.linkstreet.apps.mlink
time:200174801

07-04 15:21:04.253 12461-12551/com.linkstreet.apps.mlink I/art: Explicit
concurrent mark sweep GC freed 1901(170KB) AllocSpace objects, 7(480KB) LOS
objects, 40% free, 19MB/31MB, paused 2.866ms total 68.949ms

07-04 15:21:04.264 12461-12461/com.linkstreet.apps.mlink E/JHEAD: can't
open
'/storage/emulated/0/Android/data/com.linkstreet.apps.mlink/cache/IMG-20160702-WA0007.jpg?1467625864184'

07-04 15:21:04.274 12461-12461/com.linkstreet.apps.mlink E/android-crop:
Error reading image:
/storage/emulated/0/Android/data/com.linkstreet.apps.mlink/cache/IMG-20160702-WA0007.jpg?1467625864184:
open failed: ENOENT (No such file or directory)


 java.io.FileNotFoundException:
/storage/emulated/0/Android/data/com.linkstreet.apps.mlink/cache/IMG-20160702-WA0007.jpg?1467625864184:
open failed: ENOENT (No such file or directory)


 at libcore.io.IoBridge.open(IoBridge.java:456)


 at java.io.FileInputStream.<init>(FileInputStream.java:76)


 at java.io.FileInputStream.<init>(FileInputStream.java:103)


 at
android.content.ContentResolver.openInputStream(ContentResolver.java:667)


 at
com.soundcloud.android.crop.CropImageActivity.calculateBitmapSampleSize(CropImageActivity.java:147)


 at
com.soundcloud.android.crop.CropImageActivity.setupFromIntent(CropImageActivity.java:125)


 at
com.soundcloud.android.crop.CropImageActivity.onCreate(CropImageActivity.java:74)


 at android.app.Activity.performCreate(Activity.java:6072)


 at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)


 at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2315)


 at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2424)


 at android.app.ActivityThread.access$900(ActivityThread.java:155)


 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1323)


 at android.os.Handler.dispatchMessage(Handler.java:102)


 at android.os.Looper.loop(Looper.java:139)


 at android.app.ActivityThread.main(ActivityThread.java:5298)


 at java.lang.reflect.Method.invoke(Native Method)


 at java.lang.reflect.Method.invoke(Method.java:372)


 at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:950)


 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:745)


Caused by: android.system.ErrnoException: open failed: ENOENT (No such file
or directory)


 at libcore.io.Posix.open(Native Method)


 at libcore.io.BlockGuardOs.open(BlockGuardOs.java:186)


 at libcore.io.IoBridge.open(IoBridge.java:442)


 at java.io.FileInputStream.<init>(FileInputStream.java:76)


 at java.io.FileInputStream.<init>(FileInputStream.java:103)


 at
android.content.ContentResolver.openInputStream(ContentResolver.java:667)


 at
com.soundcloud.android.crop.CropImageActivity.calculateBitmapSampleSize(CropImageActivity.java:147)


 at
com.soundcloud.android.crop.CropImageActivity.setupFromIntent(CropImageActivity.java:125)


 at
com.soundcloud.android.crop.CropImageActivity.onCreate(CropImageActivity.java:74)


 at android.app.Activity.performCreate(Activity.java:6072)


 at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)


 at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2315)


 at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2424)


 at android.app.ActivityThread.access$900(ActivityThread.java:155)


 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1323)


 at android.os.Handler.dispatchMessage(Handler.java:102)


 at android.os.Looper.loop(Looper.java:139)


 at android.app.ActivityThread.main(ActivityThread.java:5298)


 at java.lang.reflect.Method.invoke(Native Method)


 at java.lang.reflect.Method.invoke(Method.java:372)


 at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:950)


 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:745)

from cordova-plugin-crop.

akhilesh2310 avatar akhilesh2310 commented on July 18, 2024

I am facing this issues on every device not only on marshmallow
On Jul 4, 2016 3:24 PM, "Akhilesh Bamhore" [email protected]
wrote:

[INFO:CONSOLE(1983)] "================= from isValidImage
==================", source:
file:///android_asset/www/js/controllers/appCtrl.js (1983)

07-04 15:20:49.368 12461-12461/com.linkstreet.apps.mlink I/chromium:
[INFO:CONSOLE(1984)] "
https://mlink.linkstreet.in:8001/v1/public/api/media/image/4e592cc0-41cc-11e6-96ad-af08d744f099",
source: file:///android_asset/www/js/controllers/appCtrl.js (1984)

07-04 15:21:04.055 12461-12461/com.linkstreet.apps.mlink I/Timeline:
Timeline: Activity_idle id: android.os.BinderProxy@27a5a9e9 time:200174660

07-04 15:21:04.196 12461-12640/com.linkstreet.apps.mlink I/Timeline:
Timeline: Activity_launch_request id:com.linkstreet.apps.mlink
time:200174801

07-04 15:21:04.253 12461-12551/com.linkstreet.apps.mlink I/art: Explicit
concurrent mark sweep GC freed 1901(170KB) AllocSpace objects, 7(480KB) LOS
objects, 40% free, 19MB/31MB, paused 2.866ms total 68.949ms

07-04 15:21:04.264 12461-12461/com.linkstreet.apps.mlink E/JHEAD: can't
open
'/storage/emulated/0/Android/data/com.linkstreet.apps.mlink/cache/IMG-20160702-WA0007.jpg?1467625864184'

07-04 15:21:04.274 12461-12461/com.linkstreet.apps.mlink E/android-crop:
Error reading image:
/storage/emulated/0/Android/data/com.linkstreet.apps.mlink/cache/IMG-20160702-WA0007.jpg?1467625864184:
open failed: ENOENT (No such file or directory)

java.io.FileNotFoundException:
/storage/emulated/0/Android/data/com.linkstreet.apps.mlink/cache/IMG-20160702-WA0007.jpg?1467625864184:
open failed: ENOENT (No such file or directory)

at libcore.io.IoBridge.open(IoBridge.java:456)

at java.io.FileInputStream.(FileInputStream.java:76)

at java.io.FileInputStream.(FileInputStream.java:103)

at
android.content.ContentResolver.openInputStream(ContentResolver.java:667)

at
com.soundcloud.android.crop.CropImageActivity.calculateBitmapSampleSize(CropImageActivity.java:147)

at
com.soundcloud.android.crop.CropImageActivity.setupFromIntent(CropImageActivity.java:125)

at
com.soundcloud.android.crop.CropImageActivity.onCreate(CropImageActivity.java:74)

at android.app.Activity.performCreate(Activity.java:6072)

at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)

at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2315)

at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2424)

at android.app.ActivityThread.access$900(ActivityThread.java:155)

at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1323)

at android.os.Handler.dispatchMessage(Handler.java:102)

at android.os.Looper.loop(Looper.java:139)

at android.app.ActivityThread.main(ActivityThread.java:5298)

at java.lang.reflect.Method.invoke(Native Method)

at java.lang.reflect.Method.invoke(Method.java:372)

at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:950)

at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:745)

Caused by: android.system.ErrnoException: open failed: ENOENT (No such file
or directory)

at libcore.io.Posix.open(Native Method)

at libcore.io.BlockGuardOs.open(BlockGuardOs.java:186)

at libcore.io.IoBridge.open(IoBridge.java:442)

at java.io.FileInputStream.(FileInputStream.java:76)

at java.io.FileInputStream.(FileInputStream.java:103)

at
android.content.ContentResolver.openInputStream(ContentResolver.java:667)

at
com.soundcloud.android.crop.CropImageActivity.calculateBitmapSampleSize(CropImageActivity.java:147)

at
com.soundcloud.android.crop.CropImageActivity.setupFromIntent(CropImageActivity.java:125)

at
com.soundcloud.android.crop.CropImageActivity.onCreate(CropImageActivity.java:74)

at android.app.Activity.performCreate(Activity.java:6072)

at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)

at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2315)

at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2424)

at android.app.ActivityThread.access$900(ActivityThread.java:155)

at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1323)

at android.os.Handler.dispatchMessage(Handler.java:102)

at android.os.Looper.loop(Looper.java:139)

at android.app.ActivityThread.main(ActivityThread.java:5298)

at java.lang.reflect.Method.invoke(Native Method)

at java.lang.reflect.Method.invoke(Method.java:372)

at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:950)

at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:745)

07-04 15:21:04.368 12461-12461/com.linkstreet.apps.mlink I/Timeline:
Timeline: Activity_idle id: android.os.BinderProxy@27a5a9e9 time:200174972

On Jul 4, 2016 1:42 PM, "matte5031" [email protected] wrote:

Okay so for Android 6.0+ the plugin needs a way to check if permission
isn't allowed, and if not, ask for permission?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#19 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/ALFncKgs-0DNMMP-ngTFC4K4YwRKD09bks5qSMBUgaJpZM4JEEJ-
.

from cordova-plugin-crop.

gianpaj avatar gianpaj commented on July 18, 2024

This version works on even on Android 7!
https://github.com/Nexxa/cordova-plugin-crop

The specific commits that I believe fixes this is:
Nexxa@4bf0144

from cordova-plugin-crop.

jeduan avatar jeduan commented on July 18, 2024

@gianpaj @StefanoMagrassi great work! Interested in getting this plugin transferred?

from cordova-plugin-crop.

StefanoMagrassi avatar StefanoMagrassi commented on July 18, 2024

@jeduan thank you very much, but actually I'm neither an Android nor iOS developer... You did a great job with these plugin and I just fixed some trivial bug.

from cordova-plugin-crop.

jeduan avatar jeduan commented on July 18, 2024

Neither am I!

from cordova-plugin-crop.

matte5031 avatar matte5031 commented on July 18, 2024

Nice fix! @StefanoMagrassi ! However for me some images have worse quality though, i believe it might be because it is trying to resize the image to either the default 1080 or whatever value is set in the options of {Number} [toSize=1080] . Is there anything that can be changed in the code so that it doesn't try to resize the the image. In that case what? Any help or input is highly appreciated, thanks!

from cordova-plugin-crop.

StefanoMagrassi avatar StefanoMagrassi commented on July 18, 2024

@matte5031 nope... My fork aimed to be used in order to produce a squared image with a configurable final size (or 1080px as default).

If you need to avoid this behavior you should add a condition in these lines: 76 and 77 for Android, 76 for iOS.

I probably won't do any change/enhancement because I've no time and the project in which I used my fork works fine.

from cordova-plugin-crop.

matte5031 avatar matte5031 commented on July 18, 2024

Thanks @StefanoMagrassi , the resize seem to work fine, not sure how to use it from the javascript though!
Now i use this code and the options toSize are being ignored, am i not supposed to set options like this? Would really appreciate if you could guide me on if this is correct or if it needs to be changed somehow, thanks alot!

      var options = { quality:100, toSize: 480 };
       plugins.crop.promise(imageURI, options)

from cordova-plugin-crop.

nichovski avatar nichovski commented on July 18, 2024

Add these lines in your config file. It should work fine.

<config-file parent="/manifest/application" platform="android" target="AndroidManifest.xml">
            <activity android:label="@string/multi_app_name" android:name="com.soundcloud.android.crop.CropImageActivity" android:theme="@style/Theme.AppCompat.Light" />
        </config-file>

from cordova-plugin-crop.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.