Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Adding the ExifInterface Support Library [Code Snippet]

DZone's Guide to

Adding the ExifInterface Support Library [Code Snippet]

This quick reference will teach you how to add the new ExifInterface support library to your Android 7 project.

· Mobile Zone
Free Resource

Introduction

One thing that is important to understand with Exif data is that there are no required tags; each and every tag is optional — some services even specifically strip Exif data. Therefore throughout your code, you should always handle cases where there is no Exif data, either due to no data for a specific attribute or an image format that doesn't support Exif data at all (say, the ubiquitous PNGs or WebP images).

Some Notes

This is a class for reading and writing Exif tags in a JPEG file or a RAW image file. Supported formats include: JPEG, DNG, CR2, NEF, NRW, ARW, RW2, ORF and RAF.

Also, attribute mutation is supported for JPEG image files.

Adding the Library

Add the ExifInterface Support Library to your project with the following dependency:

compile "com.android.support:exifinterface:25.1.0"

But when an Exif attribute is exactly what you need to prevent a misrotated image in your app, the ExifInterface Support Library is just what you need to #BuildBetterApps

The basics are still the same: the ability to read and write Exif tags embedded within image files: now with 140 different attributes (almost 100 of them new to Android 7.1/this Support Library!) including information about the camera itself, the camera settings, orientation, and GPS coordinates.

Topics:
android 7 ,mobile ,google ,exifinterface

Published at DZone with permission of Adam Smith. See the original article here.

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}