EXIF data and orientation

EXIF (Exchangeable Image File Format) is a standard for storing interchange information in digital photo files. Data such as shutter speed, exposure compensation, F number, what metering system was used, if a flash was used, ISO number, date and time the image was taken, whitebalance, auxiliary lenses that were used and resolution are stored by new digital cameras. Some images may even store GPS information so you can easily see where the images were taken!

Every time you take a picture with your digital camera or phone, a file (typically a JPEG) is written to your device’s storage. In addition to all the bits dedicated to the actual picture, it records a considerable amount of additional metadata. This data can include date, time, camera settings, geolocation coordinates, orientation, etc. Photo processing software, like Photoshop, can also add further metadata to EXIF.

A lot of this stuff is mundane, but it also can contain potentially sensitive information, like geolocation data (GPS coordinates where the picture was taken). That means, if you are sharing images with metadata there is a lot of details others can glean from them, expecially geotagged data. Moreover, this information increase the file size, specially with small images like the ones used on responsive web designs. A right image optimization process removes all this information before compressing the image.

Viewing EXIF data

You cannot stop EXIF metadata from being added to your photographs. It is also a good practice to save this information, since it provides useful information to manage your photo gallery later. Creation dates, geotagging, and camera settings and orientation are valuable data which can be removed later, when the images are shared and published.

One of the most powerfull tools to view metadata information is ExifTool. This open source tool is platform-independent command-line application for reading, writing, and editing meta information in a wide variety of files. ExifTool works on Windows, MacOS, and Linux and it supports many different metadata foramts including EXIF, GPS, IPTC, XMP, JFIF, GeoTIFF, ICC Profile, etc. as well as the maker notes of most of digital cameras.

spider web optimized

For instance, we are going to take a picture from StockSnack and see the metadata in it.

$ exiftool StockSnap_93KI9TC410.
ExifTool Version Number         : 10.80
File Name                       : StockSnap_93KI9TC410.jpg
Directory                       : .
File Size                       : 1982 kB
File Modification Date/Time     : 2020:03:08 17:37:16+01:00
File Access Date/Time           : 2020:03:26 16:02:55+01:00
File Inode Change Date/Time     : 2020:03:26 16:04:03+01:00
File Permissions                : rw-rw-r--
File Type                       : JPEG
File Type Extension             : jpg
MIME Type                       : image/jpeg
JFIF Version                    : 1.01
Exif Byte Order                 : Big-endian (Motorola, MM)
Processing Software             : Windows Photo Editor 10.0.10011.16384
Make                            : Canon
Camera Model Name               : Canon EOS REBEL T5
Orientation                     : Horizontal (normal)
X Resolution                    : 72
Y Resolution                    : 72
Resolution Unit                 : inches
Software                        : Windows Photo Editor 10.0.10011.16384
Modify Date                     : 2016:02:08 12:18:33
Artist                          : 
Y Cb Cr Positioning             : Co-sited
Copyright                       : 
Exposure Time                   : 1/250
F Number                        : 5.6
Exposure Program                : Aperture-priority AE
ISO                             : 200
Sensitivity Type                : Recommended Exposure Index
Recommended Exposure Index      : 200
Exif Version                    : 0230
Date/Time Original              : 2016:02:08 00:04:30
Create Date                     : 2016:02:08 00:04:30
Components Configuration        : Y, Cb, Cr, -
Shutter Speed Value             : 1/256
Aperture Value                  : 5.7
Flash                           : Off, Did not fire
Focal Length                    : 50.0 mm
Warning                         : [minor] Adjusted MakerNotes base by 4116
Macro Mode                      : Normal
Self Timer                      : Off
Quality                         : Fine
Canon Flash Mode                : Off
Continuous Drive                : Single
Focus Mode                      : One-shot AF
Record Mode                     : JPEG
Canon Image Size                : Large
Easy Mode                       : Manual
Digital Zoom                    : None
Contrast                        : Normal
Saturation                      : Normal
Metering Mode                   : Evaluative
Focus Range                     : Not Known
Canon Exposure Mode             : Aperture-priority AE
Lens Type                       : Canon EF 50mm f/1.8 STM
Max Focal Length                : 50 mm
Min Focal Length                : 50 mm
Focal Units                     : 1/mm
Max Aperture                    : 1.8
Min Aperture                    : 23
Flash Activity                  : 0
Flash Bits                      : (none)
Zoom Source Width               : 0
Zoom Target Width               : 0
Manual Flash Output             : n/a
Color Tone                      : Normal
Auto ISO                        : 100
Base ISO                        : 200
Measured EV                     : 11.88
Target Aperture                 : 5.7
Target Exposure Time            : 1/256
Exposure Compensation           : 0
White Balance                   : Cloudy
Slow Shutter                    : None
Shot Number In Continuous Burst : 0
Optical Zoom Code               : n/a
Camera Temperature              : 22 C
Flash Guide Number              : 0
Flash Exposure Compensation     : 0
Auto Exposure Bracketing        : Off
AEB Bracket Value               : 0
Control Mode                    : Camera Local Control
Measured EV 2                   : 11.5
Bulb Duration                   : 0
Camera Type                     : EOS High-end
ND Filter                       : n/a
Canon Image Type                : Canon EOS REBEL T5
Canon Firmware Version          : Firmware Version 1.0.0
Firmware Version                : 1.0.0
Contrast Standard               : 0
Sharpness Standard              : 3
Saturation Standard             : 0
Color Tone Standard             : 0
Contrast Portrait               : 0
Sharpness Portrait              : 2
Saturation Portrait             : 0
Color Tone Portrait             : 0
Contrast Landscape              : 0
Sharpness Landscape             : 4
Saturation Landscape            : 0
Color Tone Landscape            : 0
Contrast Neutral                : 0
Sharpness Neutral               : 0
Saturation Neutral              : 0
Color Tone Neutral              : 0
Contrast Faithful               : 0
Sharpness Faithful              : 0
Saturation Faithful             : 0
Color Tone Faithful             : 0
Contrast Monochrome             : -4
Sharpness Monochrome            : 3
Filter Effect Monochrome        : None
Toning Effect Monochrome        : None
Contrast Auto                   : 0
Sharpness Auto                  : 3
Saturation Auto                 : 0
Color Tone Auto                 : 0
Filter Effect Auto              : n/a
Toning Effect Auto              : n/a
Contrast User Def 1             : 0
Sharpness User Def 1            : 3
Saturation User Def 1           : 0
Color Tone User Def 1           : 0
Filter Effect User Def 1        : None
Toning Effect User Def 1        : None
Contrast User Def 2             : 0
Sharpness User Def 2            : 3
Saturation User Def 2           : 0
Color Tone User Def 2           : 0
Filter Effect User Def 2        : None
Toning Effect User Def 2        : None
Contrast User Def 3             : 0
Sharpness User Def 3            : 3
Saturation User Def 3           : 0
Color Tone User Def 3           : 0
Filter Effect User Def 3        : None
Toning Effect User Def 3        : None
User Def 1 Picture Style        : Auto
User Def 2 Picture Style        : Auto
User Def 3 Picture Style        : Auto
Canon Model ID                  : EOS Rebel T5 / 1200D / Kiss X70
Thumbnail Image Valid Area      : 0 159 7 112
AF Area Mode                    : Auto
Num AF Points                   : 9
Valid AF Points                 : 9
Canon Image Width               : 5184
Canon Image Height              : 3456
AF Image Width                  : 5184
AF Image Height                 : 3456
AF Area Widths                  : 181 129 129 129 222 129 129 129 181
AF Area Heights                 : 117 172 172 172 224 172 172 172 117
AF Area X Positions             : 0 -839 839 -1394 0 1394 -839 839 0
AF Area Y Positions             : 743 393 393 0 0 0 -393 -393 -743
AF Points In Focus              : 2,7
AF Points Selected              : 0,1,2,3,4,5,6,7,8
Time Zone                       : -07:00
Time Zone City                  : Los Angeles
Daylight Savings                : On
Bracket Mode                    : Off
Bracket Value                   : 0
Bracket Shot Number             : 0
Raw Jpg Size                    : Large
Long Exposure Noise Reduction 2 : Off
WB Bracket Mode                 : Off
WB Bracket Value AB             : 0
WB Bracket Value GM             : 0
Live View Shooting              : Off
Focus Distance Upper            : 0.87 m
Focus Distance Lower            : 0.73 m
Flash Exposure Lock             : Off
Internal Serial Number          : MA1920000
Dust Removal Data               : (Binary data 1024 bytes, use -b option to extract)
Crop Left Margin                : 0
Crop Right Margin               : 0
Crop Top Margin                 : 0
Crop Bottom Margin              : 0
Exposure Level Increments       : 1/3 Stop
ISO Expansion                   : Off
Flash Sync Speed Av             : Auto
Long Exposure Noise Reduction   : Off
High ISO Noise Reduction        : Off
Highlight Tone Priority         : Disable
AF Assist Beam                  : Emits
Shutter Button AF On Button     : Metering + AF start
Set Button When Shooting        : Normal (disabled)
Flash Button Function           : Raise built-in flash
LCD Display At Power On         : Display
Aspect Ratio                    : 3:2
Cropped Image Width             : 5184
Cropped Image Height            : 3456
Cropped Image Left              : 0
Cropped Image Top               : 0
Tone Curve                      : Standard
Sharpness                       : 3
Sharpness Frequency             : n/a
Sensor Red Level                : 0
Sensor Blue Level               : 0
White Balance Red               : 0
White Balance Blue              : 0
Color Temperature               : 5200
Picture Style                   : Auto
Digital Gain                    : 0
WB Shift AB                     : 0
WB Shift GM                     : 0
Measured RGGB                   : 424 1024 1024 702
VRD Offset                      : 0
Sensor Width                    : 5344
Sensor Height                   : 3516
Sensor Left Border              : 152
Sensor Top Border               : 56
Sensor Right Border             : 5335
Sensor Bottom Border            : 3511
Black Mask Left Border          : 0
Black Mask Top Border           : 0
Black Mask Right Border         : 0
Black Mask Bottom Border        : 0
Color Data Version              : 10 (600D/1200D)
WB RGGB Levels As Shot          : 2241 1024 1024 1479
Color Temp As Shot              : 6000
WB RGGB Levels Auto             : 2226 1024 1024 1577
Color Temp Auto                 : 5600
WB RGGB Levels Measured         : 2226 1024 1024 1577
Color Temp Measured             : 5600
WB RGGB Levels Daylight         : 2081 1024 1024 1606
Color Temp Daylight             : 5200
WB RGGB Levels Shade            : 2405 1024 1024 1367
Color Temp Shade                : 7000
WB RGGB Levels Cloudy           : 2241 1024 1024 1479
Color Temp Cloudy               : 6000
WB RGGB Levels Tungsten         : 1496 1024 1024 2405
Color Temp Tungsten             : 3200
WB RGGB Levels Fluorescent      : 1830 1024 1024 2289
Color Temp Fluorescent          : 3729
WB RGGB Levels Kelvin           : 2081 1024 1024 1606
Color Temp Kelvin               : 5200
WB RGGB Levels Flash            : 2330 1024 1024 1458
Color Temp Flash                : 6327
Average Black Level             : 2046 2046 2046 2046
Raw Measured RGGB               : 428884 1007576 959738 652781
Per Channel Black Level         : 2045 2045 2046 2046
Specular White Level            : 15094
Linearity Upper Margin          : 10000
Picture Style User Def          : Auto; Auto; Auto
Picture Style PC                : None; None; None
Custom Picture Style File Name  : 
Vignetting Corr Version         : 0
Peripheral Lighting             : Off
Chromatic Aberration Corr       : Off
Peripheral Lighting Value       : 0
Original Image Width            : 5184
Original Image Height           : 3456
Peripheral Lighting Setting     : Off
Peripheral Illumination Corr    : Off
Auto Lighting Optimizer         : Strong
Ambience Selection              : Standard
User Comment                    : 
Sub Sec Time                    : 78
Sub Sec Time Original           : 78
Sub Sec Time Digitized          : 78
Flashpix Version                : 0100
Color Space                     : sRGB
Exif Image Width                : 5184
Exif Image Height               : 3456
Interoperability Version        : 0100
Focal Plane X Resolution        : 5728.176796
Focal Plane Y Resolution        : 5808.403361
Focal Plane Resolution Unit     : inches
Custom Rendered                 : Normal
Exposure Mode                   : Auto
Scene Capture Type              : Standard
Owner Name                      : 
Serial Number                   : 162073081682
Lens Info                       : 50mm f/?
Lens Model                      : EF50mm f/1.8 STM
Lens Serial Number              : 0000224e20
Offset Schema                   : 4116
GPS Version ID                  : 2.3.0.0
Padding                         : (Binary data 2060 bytes, use -b option to extract)
Rating                          : 0
Creator Tool                    : Windows Photo Editor 10.0.10011.16384
Image Width                     : 5184
Image Height                    : 3456
Encoding Process                : Baseline DCT, Huffman coding
Bits Per Sample                 : 8
Color Components                : 3
Y Cb Cr Sub Sampling            : YCbCr4:2:0 (2 2)
Aperture                        : 5.6
Drive Mode                      : Single-frame Shooting
Image Size                      : 5184x3456
Lens                            : 50.0 mm
Lens ID                         : Canon EF 50mm f/1.8 STM
Megapixels                      : 17.9
Scale Factor To 35 mm Equivalent: 1.6
Shooting Mode                   : Aperture-priority AE
Shutter Speed                   : 1/250
Create Date                     : 2016:02:08 00:04:30.78
Date/Time Original              : 2016:02:08 00:04:30.78
Modify Date                     : 2016:02:08 12:18:33.78
WB RGGB Levels                  : 2241 1024 1024 1479
Blue Balance                    : 1.444336
Circle Of Confusion             : 0.019 mm
Depth Of Field                  : 0.05 m (0.78 - 0.83 m)
Field Of View                   : 25.8 deg
Focal Length                    : 50.0 mm (35 mm equivalent: 78.6 mm)
Hyperfocal Distance             : 23.37 m
Lens                            : 50.0 mm (35 mm equivalent: 78.6 mm)
Light Value                     : 11.9
Red Balance                     : 2.188477

Some valid image and photo file types are: JPG/JPEG, TIFF, GIF, PNG, PSD, BMP, RAW, CR2, CRW, PICT, XMP, DNG.

Geolocation data

Geolocation data are useful for geotagging, which creates all kinds of new possibilities, such as allowing users on photo-sharing sites to see any images taken in specific locations, view where your pictures were taken on a map, and to find and follow social events. Howevere they are a data leak when they are directly shared on the Internet.

Photo settings

Metadata are specially sensitive for photographes, where lots of information are shared in it, like location and camera settings. This kind of information is very useful to day-to-day work, but it must be removed when the image is published and distributed to avoid private and professional data leaks, like with stock repositories.

EXIF orientation

When images are photographed, digital cameras use orientation sensors to store an EXIF orientation value for how camera is held. This information is used later to automatically rotate your photos, saving you of this manual task.

There are 8 possible EXIF orientation values, which reflect the position of the camera with respect to the ground, numbered 1 to 8:

exif orientation values How the 8 possible EXIF values look for the letter F (credit to Dave Perrett)

Flag Orientation Description
1 0 degrees the correct orientation, no adjustment is required.
2 0 degrees, mirrored image has been flipped back-to-front.
3 180 degrees image is upside down.
4 180 degrees, mirrored image is upside down and flipped back-to-front.
5 90 degrees image is on its side.
6 90 degrees, mirrored image is on its side and flipped back-to-front.
7 270 degrees image is on its far side.
8 270 degrees, mirrored image is on its far side and flipped back-to-front.

In the 7 scenarios – 2, 3, 4, 5, 6, 7, 8 – the image need to be rotated before orientation stripped. Most common photo management programs read EXIF orientation to show photos on the right position. However, browsers don't perform this task, which means that the image or photo must be rotated before web publishing.

When you rotate or flip an image, EXIF orientation must be removed. Most programs do this task correctly, however some programs don't: like Windows Photo Viewer or Microsoft Paint. If you have some problems with photo rotation, you must fix this issue with a editing software like Photoshop, GIMP, or OSX Preview.

Removing EXIF metadata

Metadata wate several kilobytes and result in data leak. This is why is recommeded to remove EXIF data when images are published and distributed. Morevoer, images need to be rotated and correctly compressed for web pusblishing. To automatically perform all this tasks, you can easily take advantage from our image compressor for web, and get a perfectly optimized image for web with the best quality.