-
Notifications
You must be signed in to change notification settings - Fork 6.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EXIF support #172
Comments
It is a nice feature, but i don't think all photos have EXIF. |
Very useful feature! |
+1, the official Wikimedia app uses UIL, and does need this feature! Just Orientation would be more than enough, I think? Thank you! |
@yuvipanda Really? I didn't receive any notification from you :) Ok, I'll think about this feature in near future (next lib version). |
Wikimedia Commons app :) It was released only a few weeks back, and is still in beta :) I thought of notifying you once I have an about screen in place, but it isn't there yet! Thanks for the wonderful library :) |
You're welcome :) |
+1 for a rotation option. Don't think EXIF is important to me since I get the images out of the MediaStore, but it would be nice to have a display option that could be passed into the displayimage which would tell the library how to rotate the image before returning it |
+1 for rotation option! :) |
Would appreciate the EXIF support. I sometimes get pictures from media store in the wrong orientation. Happens on Samsung Galaxy Nexus. Thanx for your awesome work. |
This is the code I'm using to get a correctly oriented Bitmap from local path public static Bitmap rotate(Bitmap b, int degrees) {
if (degrees != 0 && b != null) {
Matrix m = new Matrix();
m.setRotate(degrees, (float) b.getWidth() / 2, (float) b.getHeight() / 2);
try {
Bitmap b2 = Bitmap.createBitmap(b, 0, 0, b.getWidth(), b.getHeight(), m, true);
if (b != b2) {
b.recycle();
b = b2;
}
} catch (OutOfMemoryError ex) {
throw ex;
}
}
return b;
}
public static int getCameraPhotoOrientation(Context context, Uri imageUri, String imagePath) {
int rotate = 0;
try {
context.getContentResolver().notifyChange(imageUri, null);
File imageFile = new File(imagePath);
ExifInterface exif = new ExifInterface(imageFile.getAbsolutePath());
int orientation = exif.getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_NORMAL);
switch (orientation) {
case ExifInterface.ORIENTATION_ROTATE_270:
rotate = 270;
break;
case ExifInterface.ORIENTATION_ROTATE_180:
rotate = 180;
break;
case ExifInterface.ORIENTATION_ROTATE_90:
rotate = 90;
break;
}
} catch (Exception e) {
e.printStackTrace();
}
return rotate;
} Then Bitmap b = rotate(bitmap, getCameraPhotoOrientation(context, uri, path)); It works correctly on Samsung Galaxy S, wich otherwise returns a wrong oriented bitmap. It's not my code but a mix of several SO answers. See http://stackoverflow.com/questions/4517634/picture-orientation-from-gallery-camera-intent |
I'm working on this right now. I have already implemented all needed logic and testing it. Will be soon. |
Introduced ImageLoaderConfiguration.imageDecoder(...) Introduced DisplayImageOptions.decodingOptions(...) Made ImageDecoder as interface. Added BaseImageDecoder. Extract size and scale calculation to ImageSizeUtils.
Wonderful :) Thank you! Waiting for a maven release :) |
Is there an example of how to use this? I've not been able to get this to work, reading data from a contentprovider... |
It worked for me, Just replace old jar with the new 1.8.4.jar Thanks @nostra13 , great library |
@yuvipanda EXIF support should work automatically. but it works only for local files ("file://...") or if you enable disc caching. |
Is there an option to disable exif support? I'd like to display images without taking the orientation into account... |
Only if you change lib sources. |
Hi nostra, |
@nostra13, you mentioned above that the EXIF support only works for local files or if you enable disc caching. I can't get the EXIF parameters to be respected on external urls with disc caching enabled. Maybe I'm looking in the wrong place, but it looks like in if ("image/jpeg".equalsIgnoreCase(mimeType) && Scheme.ofUri(imageUri) == Scheme.FILE) |
@doapp-baker If you enabled disc caching then BaseImageDecoder gets URLs with "file" scheme according cached file path on disk cache. Did you enable disc caching? Show your display options. |
|
Can't say what's the problem. Maybe try to debug whether |
This is a pretty bad place to get support. There are also a lot of variables here (the photo for the first 1,000). Thanks for the help. Knowing the config is right and that it should be working is a great help. Really appreciate the library, it's a LIFE SAVER. |
@doapp-baker I am using Universal Image Loader library to select multiple images and display in UI. In Samsung devices, When I open the gallery view(CustomGalleryActivity), Image orientation is not correct. If I try to rotate orientation while querying on db by checking its Exif value, it worked. But it hangs the screen for sometime. I want to rotate the image after selection coming back to show on UI(only selected images). |
I have resolved this problem by using "considerExifParams(true)" while initializing DisplaytImageOption configuration. |
Guess this one can be closed. Just out of curiosity, why isn't exif orientation enabled by default? For me this is what I expected. |
Consider EXIF orientation (and maybe some others parameters) of image files.
@All_Users Comment here if you need this feature
The text was updated successfully, but these errors were encountered: