それマグで!

知識はカップより、マグでゆっくり頂きます。 takuya_1stのブログ

習慣に早くから配慮した者は、 おそらく人生の実りも大きい。

identify 画像のexif情報を見る

exiftool が入ってない場合は、仕方ないのでidentify コマンドを使うとかも選択肢になる。

identify コマンドは出力がずらっと出てくる。
以下のように出てきてもあんまり使い道無いんですよね。

identify コマンドはimage magick に付いてきます。

identify -verbose IMMG5018.JPG

出力結果

Image: IMG_5018.JPG
  Format: JPEG (Joint Photographic Experts Group JFIF format)
  Class: DirectClass
  Geometry: 2592x1936+0+0
  Resolution: 72x72
  Print size: 36x26.8889
  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: 139.454 (0.546877)
      standard deviation: 82.3054 (0.322766)
      kurtosis: -1.47804
      skewness: -0.262303
    Green:
      min: 0 (0)
      max: 255 (1)
      mean: 137.979 (0.541092)
      standard deviation: 89.9065 (0.352575)
      kurtosis: -1.6076
      skewness: -0.21188
    Blue:
      min: 0 (0)
      max: 255 (1)
      mean: 131.79 (0.516822)
      standard deviation: 87.5526 (0.343344)
      kurtosis: -1.60729
      skewness: -0.168203
  Image statistics:
    Overall:
      min: 0 (0)
      max: 255 (1)
      mean: 136.407 (0.53493)
      standard deviation: 86.6464 (0.33979)
      kurtosis: -1.56016
      skewness: -0.214887
  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: 2592x1936+0+0
  Dispose: Undefined
  Iterations: 0
  Compression: JPEG
  Quality: 96
  Orientation: RightTop
  Properties:
    date:create: 2013-03-20T18:09:44+09:00
    date:modify: 2013-03-16T16:46:52+09:00
    exif:ApertureValue: 4281/1441
    exif:BrightnessValue: 6593/1716
    exif:ColorSpace: 1
    exif:ComponentsConfiguration: 1, 2, 3, 0
    exif:Compression: 6
    exif:CustomRendered: 2
    exif:DateTime: 2013:03:16 16:46:50
    exif:DateTimeDigitized: 2013:03:16 16:46:50
    exif:DateTimeOriginal: 2013:03:16 16:46:50
    exif:ExifImageLength: 1936
    exif:ExifImageWidth: 2592
    exif:ExifOffset: 204
    exif:ExifVersion: 48, 50, 50, 49
    exif:ExposureMode: 0
    exif:ExposureProgram: 2
    exif:ExposureTime: 1/30
    exif:Flash: 0
    exif:FlashPixVersion: 48, 49, 48, 48
    exif:FNumber: 14/5
    exif:FocalLength: 77/20
    exif:GPSAltitude: 15029/367
    exif:GPSAltitudeRef: 0
    exif:GPSInfo: 574
    exif:GPSLatitude: 34/1, 3979/100, 0/1
    exif:GPSLatitudeRef: N
    exif:GPSLongitude: 135/1, 3018/100, 0/1
    exif:GPSLongitudeRef: E
    exif:GPSTimeStamp: 7/1, 46/1, 5065/100
    exif:ISOSpeedRatings: 80
    exif:JPEGInterchangeFormat: 838
    exif:JPEGInterchangeFormatLength: 10011
    exif:Make: Apple
    exif:MeteringMode: 5
    exif:Model: iPhone 4
    exif:Orientation: 6
    exif:ResolutionUnit: 2
    exif:SceneCaptureType: 0
    exif:SensingMethod: 2
    exif:ShutterSpeedValue: 12323/2511
    exif:Software: 5.1.1
    exif:thumbnail:ResolutionUnit: 2
    exif:thumbnail:XResolution: 72/1
    exif:thumbnail:YResolution: 72/1
    exif:WhiteBalance: 0
    exif:XResolution: 72/1
    exif:YCbCrPositioning: 1
    exif:YResolution: 72/1
    jpeg:colorspace: 2
    jpeg:sampling-factor: 2x2,1x1,1x1
    signature: 8292be90ff60d0b384bded2b96865f912980a001fba07186562bff20fb13bd8a
  Profiles:
    Profile-exif: 12284 bytes
  Artifacts:
    filename: IMG_5018.JPG
    verbose: true
  Tainted: False
  Filesize: 1.833MB
  Number pixels: 5.018M
  Pixels per second: 35.84MB
  User time: 0.140u
  Elapsed time: 0:01.140

  Version: ImageMagick 6.8.0-10 2012-12-16 Q16 http://www.imagemagick.org

特定のExif情報を取り出すことも出来る

位置情報とか

takuya@rena:~/Desktop$ identify-format "%[Exif:GPSLatitude],%[Exif:GPSLongitude]\n"  /Users/takuya/Desktop/IMG_5368.jpg
34/1, xx/1, xxxx/100,134/1, xx/1, xxxx/100

撮影カメラの情報とか。

takuya@rena:~/Desktop$ identify  -format "%[Exif:Model]\n"  /Users/takuya/Desktop/IMG_5368.jpg
iPhone 4