Comments (7)
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.
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.
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.
But On Huawei P7 shows Error In Crop : Permission denied
from ucrop.
Permission denied
I guess that's because you do not handle Android M permissions.
from ucrop.
Only one device ? Huawei P7 is root Device
from ucrop.
Permission denied to open Uri with source image or to save resulting image?
from ucrop.
Related Issues (20)
- UCropActivity.setupViews android.content.res.Resources$NotFoundException - Unable to find resource ID #<address> HOT 4
- selectableItemBackground
- Artifacts Error while adding gradle dependencies ? How to resolve ? HOT 1
- Why my crop doesn't work HOT 2
- Not supported by .webq? HOT 1
- I think this repo is inactive :/
- 图片裁剪后,分辨率太低 HOT 8
- 从相册选择一张或多张图片加载到裁剪框后,相片变模糊,特别是放大图片后更明显,请问有什么解决办法吗? HOT 1
- After selecting one or more images from the album and loading them into the cropping box, the photos become blurry, especially when enlarged. Is there any solution? HOT 1
- Zoom out on images
- Fully migrate to use AndroidX
- How to change crop box to any shape i like?
- How can I disable the crop when perform rotate? How can I rotate 90° without zoom in the the image?
- 咱就是说 有没有类似的裁剪的工具类
- java.lang.NullPointerException: Attempt to get length of null array
- 选择一张旋转90度图片,按原图比例裁剪后雨裁剪框内展示的不一致
- BitmapLoadTask.java line 107 Fatal Exception: java.lang.RuntimeException An error occurred while executing doInBackground()
- Security Exception of permission
- I think this repo is inactive :/
- how to get currentAngle currentScale after croped
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ucrop.