site_treelogo
  -   Terms of Use and Privacy
Apps | GNU/Linux | Meta
rss
site_treelogo
  -   Terms of Use and Privacy
Apps | GNU/Linux | Meta
rss

<<   <   >   >>

2019-07-20 | Apps | Removing Image Metadata

Quite a bit of metadata is included in images. This metadata can be used to determine identity, among other things. There is a perl script that is available for most GNU-style package managers called exiftool by Phil Harvey that, among many other things, can display and remove metdata. Here is a list of the metadata in a jpg file, displayed by the exiftool -list command:

$exiftool -list img.jpg
.
.
.

ExifTool Version Number         : 11.48
File Name                       : img.jpg
Directory                       : .
File Size                       : 1192 kB
File Modification Date/Time     : 2019:03:06 22:02:00-08:00
File Access Date/Time           : 2019:07:20 20:53:43-07:00
File Inode Change Date/Time     : 2019:07:20 20:53:41-07:00
File Permissions                : rw-------
File Type                       : JPEG
File Type Extension             : jpg
MIME Type                       : image/jpeg
Exif Byte Order                 : Little-endian (Intel, II)
Make                            : samsung
Camera Model Name               : SM-S327VL
Orientation                     : Horizontal (normal)
X Resolution                    : 72
Y Resolution                    : 72
Resolution Unit                 : inches
Software                        : S327VLUDS4ARF2
Modify Date                     : 2019:03:02 11:05:57
Y Cb Cr Positioning             : Centered
Exposure Time                   : 1/1533
F Number                        : 1.9
Exposure Program                : Program AE
ISO                             : 40
Exif Version                    : 0220
Date/Time Original              : 2019:03:02 11:05:57
Create Date                     : 2019:03:02 11:05:57
Components Configuration        : Y, Cb, Cr, -
Shutter Speed Value             : 1/1533
Aperture Value                  : 1.9
Brightness Value                : 0
Exposure Compensation           : 0
Max Aperture Value              : 1.9
Metering Mode                   : Center-weighted average
Light Source                    : Unknown
Flash                           : No Flash
Focal Length                    : 2.5 mm
Maker Note Version              : 0100
Device Type                     : Cell Phone
Raw Data Byte Order             : Little-endian (Intel, II)
Raw Data CFA Pattern            : Swap
Face Detect                     : Off
User Comment                    : ?Z
Flashpix Version                : 0100
Color Space                     : sRGB
Exif Image Width                : 2576
Exif Image Height               : 1932
Interoperability Index          : R98 - DCF basic file (sRGB)
Interoperability Version        : 0100
Sensing Method                  : One-chip color area
Scene Type                      : Directly photographed
Exposure Mode                   : Auto
White Balance                   : Auto
Focal Length In 35mm Format     : 29 mm
Scene Capture Type              : Standard
Image Unique ID                 : M05QSJA04NA
GPS Version ID                  : 2.2.0.0
Compression                     : JPEG (old-style)
Thumbnail Offset                : 6434
Thumbnail Length                : 11233
Image Width                     : 2576
Image Height                    : 1932
Encoding Process                : Baseline DCT, Huffman coding
Bits Per Sample                 : 8
Color Components                : 3
Y Cb Cr Sub Sampling            : YCbCr4:2:0 (2 2)
Time Stamp                      : 2019:03:02 11:05:57-08:00
Aperture                        : 1.9
Shutter Speed                   : 1/1533
Thumbnail Image                 : (Binary data 11233 bytes, use -b option to extract)
Image Size                      : 2576x1932
Light Value                     : 13.8
Megapixels                      : 5.0
Scale Factor To 35 mm Equivalent: 11.7
Circle Of Confusion             : 0.003 mm
Field Of View                   : 63.7 deg
Focal Length                    : 2.5 mm (35 mm equivalent: 29.0 mm)
Hyperfocal Distance             : 1.25 m

Remove the metadata using -all= :

$exiftool -all= img.jpg
    1 image files updated
$exiftool -list img.jpg
.
.
.
ExifTool Version Number         : 11.48
File Name                       : img.jpg
Directory                       : .
File Size                       : 1174 kB
File Modification Date/Time     : 2019:07:20 20:59:09-07:00
File Access Date/Time           : 2019:07:20 20:59:12-07:00
File Inode Change Date/Time     : 2019:07:20 20:59:09-07:00
File Permissions                : rw-------
File Type                       : JPEG
File Type Extension             : jpg
MIME Type                       : image/jpeg
Image Width                     : 2576
Image Height                    : 1932
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                      : 2576x1932
Megapixels                      : 5.0

Here is how to install it on Ubuntu 18.04:

usr-1@srv-1:~$ sudo apt install exiftool
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'libimage-exiftool-perl' instead of 'exiftool'
The following additional packages will be installed:
  libmime-charset-perl libposix-strptime-perl libsombok3
  libunicode-linebreak-perl
Suggested packages:
  libencode-hanextra-perl libpod2-base-perl
The following NEW packages will be installed:
  libimage-exiftool-perl libmime-charset-perl libposix-strptime-perl
  libsombok3 libunicode-linebreak-perl
0 upgraded, 5 newly installed, 0 to remove and 177 not upgraded.
Need to get 0 B/3,311 kB of archives.
After this operation, 20.0 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
.
.
.
Processing triggers for man-db (2.8.3-2) ...
Setting up libsombok3:amd64 (2.4.0-1) ...
Setting up libposix-strptime-perl (0.13-1build3) ...
Setting up libunicode-linebreak-perl (0.0.20160702-1build2) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...
usr-1@srv-1:~$

Note that this is the only time I will take up space on this web site running a package install with output. While it is good to see this one time, there is no reason to repeat. For further information, see the package management page.

pkg_mgmt image principles