how to get image exif info with command?

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
zxsz4084
Posts: 25
Joined: 2015-03-31T01:31:44-07:00
Authentication code: 6789

how to get image exif info with command?

Post by zxsz4084 »

I found function "getImageProperties" can get exif info like this:

Code: Select all

 $im->getImageProperties("exif:*");

getImageProperties:
Array
(
    [exif:ApertureValue] => 4845/1918
    [exif:BrightnessValue] => 5241/16234
    [exif:ColorSpace] => 1
    [exif:ComponentsConfiguration] => 1, 2, 3, 0
    [exif:Compression] => 6
    [exif:DateTime] => 2015:04:13 12:37:49
    [exif:DateTimeDigitized] => 2015:04:13 12:37:49
    [exif:DateTimeOriginal] => 2015:04:13 12:37:49
    [exif:ExifImageLength] => 2448
    [exif:ExifImageWidth] => 3264
    [exif:ExifOffset] => 186
    [exif:ExifVersion] => 48, 50, 50, 49
    [exif:ExposureBiasValue] => 0/1
    [exif:ExposureMode] => 0
    [exif:ExposureProgram] => 2
    [exif:ExposureTime] => 1/20
    [exif:Flash] => 24
    [exif:FlashPixVersion] => 48, 49, 48, 48
    [exif:FNumber] => 12/5
    [exif:FocalLength] => 103/25
    [exif:FocalLengthIn35mmFilm] => 33
    [exif:ISOSpeedRatings] => 400
    [exif:JPEGInterchangeFormat] => 1078
    [exif:JPEGInterchangeFormatLength] => 12578
    [exif:Make] => Apple
    [exif:MakerNote] => 65, 112, 112, 108, 101, 32, 105, 79, 83, 0, 0, 1, 77, 77, 0, 7, 0, 1, 0, 9, 0, 0, 0, 1, 0, 0, 0, 2, 0, 3, 0, 7, 0, 0, 0, 104, 0, 0, 0, 104, 0, 4, 0, 9, 0, 0, 0, 1, 0, 0, 0, 1, 0, 5, 0, 9, 0, 0, 0, 1, 0, 0, 0, 167, 0, 6, 0, 9, 0, 0, 0, 1, 0, 0, 0, 166, 0, 7, 0, 9, 0, 0, 0, 1, 0, 0, 0, 1, 0, 8, 0, 10, 0, 0, 0, 3, 0, 0, 0, 208, 0, 0, 0, 0, 98, 112, 108, 105, 115, 116, 48, 48, 212, 1, 2, 3, 4, 5, 6, 7, 8, 89, 116, 105, 109, 101, 115, 99, 97, 108, 101, 85, 118, 97, 108, 117, 101, 85, 101, 112, 111, 99, 104, 85, 102, 108, 97, 103, 115, 18, 59, 154, 202, 0, 19, 0, 0, 93, 249, 193, 199, 152, 72, 16, 0, 16, 1, 8, 17, 27, 33, 39, 45, 50, 59, 61, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 3, 227, 0, 1, 188, 173, 255, 255, 238, 249, 0, 0, 18, 115, 255, 255, 248, 16, 0, 0, 21, 11
    [exif:MeteringMode] => 5
    [exif:Model] => iPhone 5
    [exif:Orientation] => 6
    [exif:ResolutionUnit] => 2
    [exif:SceneCaptureType] => 0
    [exif:SceneType] => 1
    [exif:SensingMethod] => 2
    [exif:ShutterSpeedValue] => 3799/879
    [exif:Software] => 8.3
    [exif:SubjectArea] => 1631, 1223, 1795, 1077
    [exif:SubSecTimeDigitized] => 411
    [exif:SubSecTimeOriginal] => 411
    [exif:WhiteBalance] => 0
    [exif:XResolution] => 72/1
    [exif:YCbCrPositioning] => 1
    [exif:YResolution] => 72/1
)
but now my server does not install imagick.so extension and I am not a server administrator。
I don't know how to get exif info via using command ? who can help me ? Thanks .
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: how to get image exif info with command?

Post by snibgo »

convert in.jpg -format %[EXIF:*] info:
snibgo's IM pages: im.snibgo.com
zxsz4084
Posts: 25
Joined: 2015-03-31T01:31:44-07:00
Authentication code: 6789

Re: how to get image exif info with command?

Post by zxsz4084 »

snibgo wrote:convert in.jpg -format %[EXIF:*] info:
Dear snibgo:
I am very glad to see you again。

Today I get a question from an ios developer ,he says an img created by iPhone camera size 2448 x 3264 ,but upload to server it return json shows size 3264 x 2448 ,the width and the height is upside down。
I find php function “getimagesize” result is just 3264 x 2448 。I have found some info about exif。It may related to the exif:Orientation 。

http://www.impulseadventure.com/photo/e ... ation.html

when exif:Orientation equal 6 or 8 , should exchange the width with the height each other ?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: how to get image exif info with command?

Post by snibgo »

snibgo's IM pages: im.snibgo.com
Post Reply