Posted 8 months ago. Visible to the public.

How to view Image Metadata on the Linux Command Line with ImageMagick

ImageMagick has a command line tool called identify which can read image metadata:

Copy
>identify -verbose DSC00136.JPG Image: DSC00136.JPG Format: JPEG (Joint Photographic Experts Group JFIF format) Class: DirectClass Geometry: 5472x3648+0+0 Resolution: 350x350 Print size: 15.6343x10.4229 Units: PixelsPerInch Type: TrueColor Endianess: Undefined Colorspace: sRGB Depth: 8-bit Channel depth: red: 8-bit green: 8-bit blue: 8-bit Channel statistics: Red: min: 0 (0) max: 255 (1) mean: 110.006 (0.431397) standard deviation: 56.3503 (0.220982) kurtosis: -0.715336 skewness: 0.213533 Green: min: 0 (0) max: 255 (1) mean: 121.262 (0.475538) standard deviation: 53.9487 (0.211564) kurtosis: -0.63713 skewness: 0.0561087 Blue: min: 0 (0) max: 255 (1) mean: 93.6208 (0.36714) standard deviation: 61.9764 (0.243045) kurtosis: -0.714232 skewness: 0.354529 Image statistics: Overall: min: 0 (0) max: 255 (1) mean: 108.296 (0.424692) standard deviation: 57.5236 (0.225583) kurtosis: -0.547204 skewness: 0.159057 Rendering intent: Perceptual Gamma: 0.454545 Chromaticity: red primary: (0.64,0.33) green primary: (0.3,0.6) blue primary: (0.15,0.06) white point: (0.3127,0.329) Interlace: None Background color: white Border color: srgb(223,223,223) Matte color: grey74 Transparent color: black Compose: Over Page geometry: 5472x3648+0+0 Dispose: Undefined Iterations: 0 Compression: JPEG Quality: 95 Orientation: TopLeft Properties: date:create: 2015-08-21T10:32:36+02:00 date:modify: 2015-08-14T17:44:46+02:00 exif:BrightnessValue: 14784/2560 exif:ColorSpace: 1 exif:ComponentsConfiguration: 1, 2, 3, 0 exif:CompressedBitsPerPixel: 3/1 exif:Compression: 6 exif:Contrast: 0 exif:CustomRendered: 0 exif:DateTime: 2015:08:14 17:44:47 exif:DateTimeDigitized: 2015:08:14 17:44:47 exif:DateTimeOriginal: 2015:08:14 17:44:47 exif:DigitalZoomRatio: 16/16 exif:ExifImageLength: 3648 exif:ExifImageWidth: 5472 exif:ExifOffset: 290 exif:ExifVersion: 48, 50, 51, 48 exif:ExposureBiasValue: 0/10 exif:ExposureMode: 0 exif:ExposureProgram: 2 exif:ExposureTime: 1/80 exif:FileSource: 3 exif:Flash: 16 exif:FlashPixVersion: 48, 49, 48, 48 exif:FNumber: 40/10 exif:FocalLength: 1684/100 exif:FocalLengthIn35mmFilm: 46 exif:ImageDescription: exif:InteroperabilityIndex: R98 exif:InteroperabilityOffset: 31652 exif:InteroperabilityVersion: 48, 49, 48, 48 exif:ISOSpeedRatings: 125 exif:JPEGInterchangeFormat: 31948 exif:JPEGInterchangeFormatLength: 12642 exif:LightSource: 0 exif:Make: SONY exif:MakerNote: 83, 79, 78, 89, 32, 68, 83, 67, 32, 0, 0, 0, 91, 0, 3, 16, 4, 0, 16, 0, 0, 0, 150, 7, 0, 0, 0, 32, 7, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 32, 4, 0, 1, 0, 0, 0, 0, 0, 0, 0, 3, 32, 2, 0, 0, 1, 0, 0, 214, 7, 0, 0, 4, 32, 9, 0, 1, 0, 0, 0, 0, 0, 0, 0, 5, 32, 9, 0, 1, 0, 0, 0, 0, 0, 0, 0, 6, 32, 9, 0, 1, 0, 0, 0, 0, 0, 0, 0, 7, 32, 9, 0, 1, 0, 0, 0, 0, 0, 0, 0, 8, 32, 4, 0, 1, 0, 0, 0, 1, 0, 0, 0, 9, 32, 3, 0, 1, 0, 0, 0, 2, 0, 0, 0, 10, 32, 4, 0, 1, 0, 0, 0, 0, 0, 0, 0, 12, 32, 4, 0, 3, 0, 0, 0, 214, 8, 0, 0, 13, 32, 5, 0, 1, 0, 0, 0, 226, 8, 0, 0, 20, 32, 9, 0, 2, 0, 0, 0, 234, 8, 0, 0, 0, 48, 7, 0, 134, 1, 0, 0, 242, 8, 0, 0, 32, 176, 2, 0, 16, 0, 0, 0, 120, 10, 0, 0, 33, 176, 4, 0, 1, 0, 0, 0, 0, 0, 0, 0, 34, 176, 4, 0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7, 0, 144, 1, 0, 0, 16, 29, 0, 0, 3, 148, 7, 0, 232, 3, 0, 0, 160, 30, 0, 0, 4, 148, 7, 0, 44, 2, 0, 0, 136, 34, 0, 0, 5, 148, 7, 0, 0, 8, 0, 0, 180, 36, 0, 0, 7, 148, 7, 0, 64, 0, 0, 0, 180, 44, 0, 0, 8, 148, 7, 0, 232, 3, 0, 0, 244, 44, 0, 0, 9, 148, 7, 0, 64, 5, 0, 0, 220, 48, 0, 0, 10, 148, 7, 0, 16, 1, 0, 0, 28, 54, 0, 0, 11, 148, 7, 0, 144, 1, 0, 0, 44, 55, 0, 0, 12, 148, 7, 0, 64, 0, 0, 0, 188, 56, 0, 0, 13, 148, 7, 0, 236, 4, 0, 0, 252, 56, 0, 0, 0, 161, 7, 0, 64, 0, 0, 0, 232, 61, 0, 0, 16, 32, 7, 0, 156, 25, 0, 0, 40, 62, 0, 0, 80, 144, 7, 0, 176, 3, 0, 0, 196, 87, 0, 0, 16, 148, 7, 0, 72, 14, 0, 0, 116, 91, 0, 0, 17, 148, 7, 0, 224, 16, 0, 0, 188, 105, 0, 0, 18, 148, 7, 0, 160, 0, 0, 0, 156, 122, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 exif:MaxApertureValue: 760/256 exif:MeteringMode: 5 exif:Model: DSC-RX100M3 exif:Orientation: 1 exif:PrintImageMatching: 80, 114, 105, 110, 116, 73, 77, 0, 48, 51, 48, 48, 0, 0, 2, 0, 2, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0 exif:ResolutionUnit: 2 exif:Saturation: 0 exif:SceneCaptureType: 0 exif:SceneType: 1 exif:Sharpness: 0 exif:Software: DSC-RX100M3 v1.20 exif:UserComment: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 exif:WhiteBalance: 0 exif:XResolution: 350/1 exif:YCbCrPositioning: 2 exif:YResolution: 350/1 jpeg:colorspace: 2 jpeg:sampling-factor: 2x1,1x1,1x1 signature: 21b79461fec27186f598415af36de51b3385203b4648ef5eb4c2e87b079ed952 unknown: 2 Profiles: Profile-exif: 44596 bytes Artifacts: filename: DSC00136.JPG verbose: true Tainted: True Filesize: 8.71MB Number pixels: 19.96M Pixels per second: 95.06MB User time: 0.210u Elapsed time: 0:01.210 Version: ImageMagick 6.7.7-10 2017-03-14 Q16 http://www.imagemagick.org

This can be useful to debug errors caused by corrupt image metadata.

By refactoring problematic code and creating automated tests, makandra can vastly improve the maintainability of your Rails application.

Author of this card:

Avatar
Judith Roth
Last edit:
8 months ago
by Judith Roth
About this deck:
We are makandra and do test-driven, agile Ruby on Rails software development.
License for source code
Posted by Judith Roth to makandropedia