Giter Club home page Giter Club logo

Comments (7)

PGMacDesign avatar PGMacDesign commented on May 20, 2024 1

Took some digging, but figured out the issue.
Basically, it is a KitKat permissions problem (Any device on 4.4,4+ will have it).
YOU (the app creator) have requested permission for the app to work on these files that require permission. THEY (any third party library using the photo for, let's say, cropping) do not have explicit permission from the system to access it.

Simple solution:
When you get the photoUri back from the intent, before you call the crop activity on the Uri, just make a copy in cache and send the Uri to THAT file instead. Code sample here if you need it.

from ucrop.

timkoers avatar timkoers commented on May 20, 2024

Please take a look at the sample app and code. That code works for me.

Van: HosseinKurd [email protected]
verzonden: 7 mrt. 2016 10:46 AM
Aan: Yalantis/uCrop
Onderwerp: [uCrop] Error After Crop 'Is a directory' (#53)

I tried to crop photo and fix some errors

at onActivityResult Log Errors

if(resultCode == UCrop.RESULT_ERROR){
Throwable cropError = UCrop.getError(data);
LTH.eLog(PHOTO_TAG, PurchaseAsync.TAG + " -> UCrop RESULT ERROR");
LTH.eLog(PHOTO_TAG, PurchaseAsync.TAG + " -> Error In Crop : " + cropError.getMessage(), cropError);
}

Message : Is a directory

java.io.FileNotFoundException: Is a directory
        at android.os.Parcel.openFileDescriptor(Native Method)
        at android.os.ParcelFileDescriptor.openInternal(ParcelFileDescriptor.java:252)
        at android.os.ParcelFileDescriptor.open(ParcelFileDescriptor.java:198)
        at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:899)
        at android.content.ContentResolver.openOutputStream(ContentResolver.java:669)
        at android.content.ContentResolver.openOutputStream(ContentResolver.java:645)
        at com.yalantis.ucrop.UCropActivity.cropAndSaveImage(UCropActivity.java:534)
        at com.yalantis.ucrop.UCropActivity.onOptionsItemSelected(UCropActivity.java:124)
        at android.app.Activity.onMenuItemSelected(Activity.java:2600)
        at android.support.v4.app.FragmentActivity.onMenuItemSelected(FragmentActivity.java:404)
        at android.support.v7.app.AppCompatActivity.onMenuItemSelected(AppCompatActivity.java:167)
        at android.support.v7.view.WindowCallbackWrapper.onMenuItemSelected(WindowCallbackWrapper.java:100)
        at android.support.v7.view.WindowCallbackWrapper.onMenuItemSelected(WindowCallbackWrapper.java:100)
        at android.support.v7.app.ToolbarActionBar$2.onMenuItemClick(ToolbarActionBar.java:69)
        at android.support.v7.widget.Toolbar$1.onMenuItemClick(Toolbar.java:169)
        at android.support.v7.widget.ActionMenuView$MenuBuilderCallback.onMenuItemSelected(ActionMenuView.java:760)
        at android.support.v7.view.menu.MenuBuilder.dispatchMenuItemSelected(MenuBuilder.java:811)
        at android.support.v7.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:152)
        at android.support.v7.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:958)
        at android.support.v7.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:948)
        at android.support.v7.widget.ActionMenuView.invokeItem(ActionMenuView.java:618)
        at android.support.v7.view.menu.ActionMenuItemView.onClick(ActionMenuItemView.java:139)
        at android.view.View.performClick(View.java:4438)
        at android.view.View$PerformClick.run(View.java:18422)
        at android.os.Handler.handleCallback(Handler.java:733)
        at android.os.Handler.dispatchMessage(Handler.java:95)
        at android.os.Looper.loop(Looper.java:136)
        at android.app.ActivityThread.main(ActivityThread.java:5017)
        at java.lang.reflect.Method.invokeNative(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:515)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
        at dalvik.system.NativeStart.main(Native Method)

Reply to this email directly or view it on GitHub:
#53

from ucrop.

HosseinKurd avatar HosseinKurd commented on May 20, 2024

Thank You
I Found It
UCrop.of(uri, mImageCaptureUri)
Instead Of UCrop.of(mImageCaptureUri, getUriFromPath())

From onActivityResult Intent data , data.getData() Is Input Value To doCrop

from ucrop.

HosseinKurd avatar HosseinKurd commented on May 20, 2024

But On Huawei P7 shows Error In Crop : Permission denied

from ucrop.

shliama avatar shliama commented on May 20, 2024

Permission denied

I guess that's because you do not handle Android M permissions.

from ucrop.

HosseinKurd avatar HosseinKurd commented on May 20, 2024

Only one device ? Huawei P7 is root Device

from ucrop.

shliama avatar shliama commented on May 20, 2024

Permission denied to open Uri with source image or to save resulting image?

from ucrop.

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.