LoginSignup
34
25

More than 5 years have passed since last update.

exif情報をコマンド一発で削除する

Last updated at Posted at 2014-07-07

exif情報をコマンド一発で削除する

iPhoneで撮った写真には位置情報などのexif情報が含まれているので、Webにアップロードする前には削除したい。そんなときは exiftool で一発だ。

exiftoolをbrewでインストール

Macでhomebrewが入っていれば簡単にexiftoolはインストールできる。

brew install exiftool

exiftoolでexifを消す

下記でカレントディレクトリの IMG_*.JPG にマッチするファイルからすべてのexif情報が削除される。ちなみにexifを含むオリジナルのデータは IMG_*.JPG_original としてバックアップされる。

exiftool -all= ./IMG_*.JPG

消えているか確認する

exiftool [ファイル名] でexifを確認できる。こんな感じでメタな情報は表示されない。

$ exiftool IMG_8706.JPG

ExifTool Version Number         : 9.58
File Name                       : IMG_8706.JPG
Directory                       : .
File Size                       : 1985 kB
File Modification Date/Time     : 2014:07:07 22:42:20+09:00
File Access Date/Time           : 2014:07:07 22:42:20+09:00
File Inode Change Date/Time     : 2014:07:07 22:42:20+09:00
File Permissions                : rw-------
File Type                       : JPEG
MIME Type                       : image/jpeg
Image Width                     : 3264
Image Height                    : 2448
Encoding Process                : Baseline DCT, Huffman coding
Bits Per Sample                 : 8
Color Components                : 3
Y Cb Cr Sub Sampling            : YCbCr4:2:0 (2 2)
Image Size                      : 3264x2448

ちなみにオリジナルのexifも同様に確認するとこんなに含まれている。iPhone5で北緯 00 deg 00' 00.00" 東経 000 deg 00' 00.00" 海抜82mの位置から北西を向いて撮った事がわかりますね。どの建物名どころか、下手したら階数とか号室までわかっちゃう訳ですので気をつけましょう。でも写ってる画像から周辺の状況がわかっては意味が無いんですがね。

exiftool IMG_8706.JPG_original

ExifTool Version Number         : 9.58
File Name                       : IMG_8706.JPG_original
Directory                       : .
File Size                       : 1990 kB
File Modification Date/Time     : 2014:07:07 22:32:38+09:00
File Access Date/Time           : 2014:07:07 22:42:20+09:00
File Inode Change Date/Time     : 2014:07:07 22:32:39+09:00
File Permissions                : rw-------
File Type                       : JPEG
MIME Type                       : image/jpeg
JFIF Version                    : 1.01
Profile CMM Type                : Lino
Profile Version                 : 2.1.0
Profile Class                   : Display Device Profile
Color Space Data                : RGB
Profile Connection Space        : XYZ
Profile Date Time               : 1998:02:09 06:49:00
Profile File Signature          : acsp
Primary Platform                : Microsoft Corporation
CMM Flags                       : Not Embedded, Independent
Device Manufacturer             : IEC
Device Model                    : sRGB
Device Attributes               : Reflective, Glossy, Positive, Color
Rendering Intent                : Perceptual
Connection Space Illuminant     : 0.9642 1 0.82491
Profile Creator                 : HP
Profile ID                      : 0
Profile Copyright               : Copyright (c) 1998 Hewlett-Packard Company
Profile Description             : sRGB IEC61966-2.1
Media White Point               : 0.95045 1 1.08905
Media Black Point               : 0 0 0
Red Matrix Column               : 0.43607 0.22249 0.01392
Green Matrix Column             : 0.38515 0.71687 0.09708
Blue Matrix Column              : 0.14307 0.06061 0.7141
Device Mfg Desc                 : IEC http://www.iec.ch
Device Model Desc               : IEC 61966-2.1 Default RGB colour space - sRGB
Viewing Cond Desc               : Reference Viewing Condition in IEC61966-2.1
Viewing Cond Illuminant         : 19.6445 20.3718 16.8089
Viewing Cond Surround           : 3.92889 4.07439 3.36179
Viewing Cond Illuminant Type    : D50
Luminance                       : 76.03647 80 87.12462
Measurement Observer            : CIE 1931
Measurement Backing             : 0 0 0
Measurement Geometry            : Unknown (0)
Measurement Flare               : 0.999%
Measurement Illuminant          : D65
Technology                      : Cathode Ray Tube Display
Red Tone Reproduction Curve     : (Binary data 2060 bytes, use -b option to extract)
Green Tone Reproduction Curve   : (Binary data 2060 bytes, use -b option to extract)
Blue Tone Reproduction Curve    : (Binary data 2060 bytes, use -b option to extract)
Exif Byte Order                 : Big-endian (Motorola, MM)
Make                            : Apple
Camera Model Name               : iPhone 5
Orientation                     : Horizontal (normal)
X Resolution                    : 72
Y Resolution                    : 72
Resolution Unit                 : inches
Software                        : 7.1.2
Modify Date                     : 2014:07:07 21:52:36
Exposure Time                   : 1/20
F Number                        : 2.4
Exposure Program                : Program AE
ISO                             : 50
Exif Version                    : 0221
Date/Time Original              : 2014:07:07 21:52:36
Create Date                     : 2014:07:07 21:52:36
Components Configuration        : Y, Cb, Cr, -
Shutter Speed Value             : 1/20
Aperture Value                  : 2.4
Brightness Value                : 3.210835783
Metering Mode                   : Multi-segment
Flash                           : Off, Did not fire
Focal Length                    : 4.1 mm
Subject Area                    : 1631 1223 1795 1077
Run Time Flags                  : Valid
Run Time Value                  : 233503569346250
Run Time Scale                  : 1000000000
Run Time Epoch                  : 0
Sub Sec Time Original           : 221
Sub Sec Time Digitized          : 221
Flashpix Version                : 0100
Color Space                     : sRGB
Exif Image Width                : 3264
Exif Image Height               : 2448
Sensing Method                  : One-chip color area
Scene Type                      : Directly photographed
Exposure Mode                   : Auto
White Balance                   : Auto
Focal Length In 35mm Format     : 33 mm
Scene Capture Type              : Standard
Lens Info                       : 4.12mm f/2.4
Lens Make                       : Apple
Lens Model                      : iPhone 5 back camera 4.12mm f/2.4
GPS Latitude Ref                : North
GPS Longitude Ref               : East
GPS Altitude Ref                : Above Sea Level
GPS Time Stamp                  : 12:52:35
GPS Img Direction Ref           : True North
GPS Img Direction               : 299.2357724
GPS Date Stamp                  : 2014:07:07
XMP Toolkit                     : XMP Core 5.4.0
Creator Tool                    : 7.1.2
Date Created                    : 2014:07:07 21:52:36
Image Width                     : 3264
Image Height                    : 2448
Encoding Process                : Baseline DCT, Huffman coding
Bits Per Sample                 : 8
Color Components                : 3
Y Cb Cr Sub Sampling            : YCbCr4:2:0 (2 2)
Aperture                        : 2.4
GPS Altitude                    : 82 m Above Sea Level
GPS Date/Time                   : 2014:07:07 12:52:35Z
GPS Latitude                    : 00 deg 00' 00.00" N
GPS Longitude                   : 000 deg 00' 00.00" E
GPS Position                    : 00 deg 00' 00.00" N, 000 deg 00' 00.00" E
Image Size                      : 3264x2448
Run Time Since Power Up         : 2 days 16:51:43
Scale Factor To 35 mm Equivalent: 8.0
Shutter Speed                   : 1/20
Create Date                     : 2014:07:07 21:52:36.221
Date/Time Original              : 2014:07:07 21:52:36.221
Circle Of Confusion             : 0.004 mm
Field Of View                   : 57.2 deg
Focal Length                    : 4.1 mm (35 mm equivalent: 33.0 mm)
Hyperfocal Distance             : 1.89 m
Light Value                     : 7.8
34
25
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
34
25