Images taken with ACTION_IMAGE_CAPTURE always returns 1 for ExifInterface.TAG_ORIENTATION on some Gingerbread devices

Ok guys, it seems like this bug for android won’t be fixed for a while. Although I found a way to implement the ExifInformation so that both devices (ones with proper Exif tag, and also improper exif tags work together).. So the issue is on some (newer) devices, there’s a bug that makes the picture … Read more

Extract EXIF data as text using ImageMagick

Like this: identify -format ‘%[EXIF:*]’ image.jpg Output: exif:ApertureValue=4845/1918 exif:BrightnessValue=4991/792 exif:ColorSpace=1 exif:ComponentsConfiguration=1, 2, 3, 0 exif:Compression=6 exif:DateTime=2014:08:31 14:18:07 exif:DateTimeDigitized=2014:08:31 14:18:07 exif:DateTimeOriginal=2014:08:31 14:18:07 exif:ExifImageLength=2448 exif:ExifImageWidth=3264 exif:ExifOffset=204 exif:ExifVersion=48, 50, 50, 49 … …

A final answer on how to get Exif data from URI

To expand on alex.dorokhov’s answer with some sample code. The support library is a great way to go. build.gradle dependencies { … compile “com.android.support:exifinterface:25.0.1” … } Example code: import android.support.media.ExifInterface; … try (InputStream inputStream = context.getContentResolver().openInputStream(uri)) { ExifInterface exif = new ExifInterface(inputStream); int orientation = exif.getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_NORMAL); } catch (IOException e) { e.printStackTrace(); } The … Read more

Rotating an image with orientation specified in EXIF using Python without PIL including the thumbnail

This solution works for me: PIL thumbnail is rotating my image? Don’t need to check if it’s iPhone or iPad: if photo has orientation tag – rotate it. from PIL import Image, ExifTags try: image=Image.open(filepath) for orientation in ExifTags.TAGS.keys(): if ExifTags.TAGS[orientation]==’Orientation’: break exif = image._getexif() if exif[orientation] == 3: image=image.rotate(180, expand=True) elif exif[orientation] == 6: … Read more

Get Exif data from UIImage – UIImagePickerController [duplicate]

Interesting question! I came up with the following solution working for images picked from your photo library (note my code is using ARC): Import AssetsLibrary.framework and ImageIO.framework. Then include the needed classes inside your .h-file: #import <AssetsLibrary/ALAsset.h> #import <AssetsLibrary/ALAssetRepresentation.h> #import <ImageIO/CGImageSource.h> #import <ImageIO/CGImageProperties.h> And put this inside your imagePickerController:didFinishPickingMediaWithInfo: delegate method: ALAssetsLibrary *library = [[ALAssetsLibrary … Read more

Is there a way to tell browsers to honor the jpeg exif orientation?

CSS image-orientation: from-image from the specs https://www.w3.org/TR/css4-images/#the-image-orientation 6.2. Orienting an Image on the Page: the ‘image-orientation’ property image-orientation: from-image from-image: If the image has an orientation specified in its metadata, such as EXIF, this value computes to the angle that the metadata specifies is necessary to correctly orient the image. If necessary, this angle is … Read more