Comments (18)
Do you use setImageUriAsync(Uri)
method to set the image? if so it will read the exif data automatically.
How Picasso is helping you?
from android-image-cropper.
Yes, I use mCropImageView.setImageUriAsync(Uri.parse(mUriStr)) to set the image. I guess It doesn't work because there's no ExifInfo available. To be honest, I never dig deeply into how Picasso works. But every time I use Picasso.with(context).load(uri).into(imageView), it will fix the problem automatically.
from android-image-cropper.
Without exif data I don't see how Picasso could "fix" it...
Can you upload an image taken from camera, maybe I don;t handle the exif data correctly..
from android-image-cropper.
from android-image-cropper.
I need the original image from camera, not screen capture, sorry I wan't clear
from android-image-cropper.
from android-image-cropper.
Hi again, sorry, I told you wrong information. In this case, orientation == ExifInterface.ORIENTATION_ROTATE_90. I tried rotateImage(bitmap, 90) but it doesn't work.
public static Bitmap rotateImage(Bitmap src, int degree) {
int w = src.getWidth();
int h = src.getHeight();
Matrix mtx = new Matrix();
mtx.postRotate(degree);
Timber.e("degree: %d", degree);
return Bitmap.createBitmap(src, 0, 0, w, h, mtx, true);
}
from android-image-cropper.
Hi again, do you have an idea where the bug could be? Maybe I can help as I need this library for a project that needs to be delivered soon. Thanks for letting me know.
from android-image-cropper.
I'm not sure as the images you uploaded are very confusing... the image with the coffee cup looks corrupted, half of it is white...
Lets help each other, I believe i will find the bug quickly when I get an image with the exif data. Unfortunately github changed the images, probably during the upload, can you upload them to this public one drive folder, thx.
p.s. you should not rotate the image manually, when using setImageUriAsync(Uri)
it should just work, it reads the exif data and does the rotation internally.
Also it's not clear to me when you rotates the bitmap...
from android-image-cropper.
I rotate the image in onActivityResult before the app goes to the cropping screen. The images should be there. Thank you and keep me posted.
from android-image-cropper.
I don't get it... the images don't have exif data and are correctly oriented...
are you able to reproduce the issue in the library sample app?
from android-image-cropper.
Sorry for the delay. It takes me a while to get the sample run. It works for me. Any suggestions?
from android-image-cropper.
Ok... I'm 98% sure the library handles the images correctly.
We need to understand what your code does different than the sample.
See MainActivity.onActivityResult
method, there is a bit of code to handle new permissions system but basically it calls mCurrentFragment.setImageUri(imageUri)
that will set the image for cropping using mCropImageView.setImageUriAsync(imageUri)
.
imageUri
is an Android reference URI instance that is retrieved from CropImageHelper.getPickImageResultUri(this, data)
that has the logic to get the correct URI depending if the source is camera app of gallery app.
Note that it doesn't load the bitmap, or read the exif data at any point in the sample, all the work is done in setImageUriAsync(Uri)
that is part of the library.
Now, what happens in your code?
If you can post it, that may help too.
from android-image-cropper.
I might know where goes wrong. In MainActivity.onActivityResult method, after the app gets mFileUri = CropImageHelper.getPickImageResultUri(this, data), it replaces the current fragment with a new fragment and displays the image in the new Fragment. Let me try something first and get back to you. Thank you.
from android-image-cropper.
Hi, it works now! Instead of replacing the current fragment with a new fragment, I create a pair of Activity and Fragment to display the image. I also use CropImageHelper.startPickImageActivity(this) instead of using my own methods.
from android-image-cropper.
Awesome! glad it worked out.
from android-image-cropper.
Thank you for this amazing library!
from android-image-cropper.
Hello Sir,
I am facing same problem for image capture in samsung device and image rotate automatically ,
i have check other device but image is set potrait format , i have use picasso library to resize the
image.
Pleaase provide me any suggestion and help for solve this problem !!!!!!
from android-image-cropper.
Related Issues (20)
- error in manifest about CropImageActivity HOT 1
- Native crash in "libc.so tgkill" at SupportRequestManagerFragment HOT 1
- activity is not found in project or libraies AndroidManifest.xml HOT 1
- The camera not working above android version 11.. HOT 5
- Start Activity with request code HOT 1
- RLÒP?PPÒÌUIUYYYTTTTTRRRÀ¹³⁴¹1L2J⁴⁶⁶⁷⁸⁹⁰=/ HOT 1
- The bottom of the cropped image is not fully displayed HOT 1
- Class referenced in the manifest was not found in the project or the libraries HOT 2
- The dependencies are not found in android 12 HOT 1
- Camera Issues (Android 11 and 12) HOT 6
- Cropped picture clarity is so poor HOT 3
- Could not find com.hendraanggrian.appcompat:socialview:0.3. Required by: project :app Search in build.gradle files HOT 2
- pick from google drive HOT 1
- Not showing any other options but opening camera only HOT 1
- i cant use the crop image !! HOT 1
- Unable to use images from camera HOT 3
- Error while importing HOT 6
- Veracode - vulnerabilities
- i can't build HOT 1
- cant use preview camera view on this cropper
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 android-image-cropper.