Yalantis / uCrop

Image Cropping Library for Android
https://yalantis.com/blog/introducing-ucrop-our-own-image-cropping-library-for-android/
11.86k stars 2.16k forks source link

CImg<unsigned char>::load(): Failed to recognize format of file #193

Closed olivercm closed 7 years ago

olivercm commented 8 years ago

Do you want to request a feature or report a bug? report a bug What is the current behavior? result code is UCrop.RESULT_ERROR What is the expected behavior? normal If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. modify file name to '/storage/emulated/0/PictureUnlock_59545_14730639426357.jpg@.pictureunlock.jpg', and select it, crop。The file name has two '.jpg' 。 Please attach any image files, URL and stack trace that can be used to reproduce the bug. '/storage/emulated/0/PictureUnlock_59545_14730639426357.jpg@.pictureunlock.jpg'

Which versions of uCrop, and which Android API versions are affected by this issue? Did this work in previous versions of uCrop? 2.1.2

shliama commented 8 years ago

@olivercm thanks for the issue. I think it's up to you to provide URI with the proper file name to the uCrop. So if you know that it can happen in your app - please modify the filename so it can be recognised by uCrop and native libraries.

olivercm commented 8 years ago

@shliama I found this bug not by modifying image uri to test UCrop. I first find it in some mobiles that have pictures in that format. So we not sure whether image in mobiles of consumer will have similiar format or not. Of course, modifying image uri to normal can fix the bug. Thanks for your time.

LittleKu commented 8 years ago

@olivercm I got the same issue, can you show me how to modifying image uri to normal ? I'm newbie on android

edited: I fixed this bug with compress the photo, in other words is change the photo format

olivercm commented 8 years ago

@LittleKu I did the same