Media



Read & Remove EXIF Data From the Command Line

Most digital cameras will insert metadata into images. This metadata is stored using the exchangeable image file format (EXIF) and can contain camera specifications, exposure settings, thumbnails, GPS coordinates and more. This article outlines some Linux command line tools you can use for reading, editing and removing EXIF metadata from images.

Reading and Editing EXIF Metadata with ExifTool

ExifTool is powerful a Perl program that can be used to read and edit EXIF metadata in images. To install ExifTool as /usr/bin/exiftool on Fedora, install the perl-Image-ExifTool package:

su -c 'yum install perl-Image-ExifTool'

Alternatively, you can use CPAN to install ExifTool in /usr/local/bin/exiftool.

su -c "perl -MCPAN -e'install Image::ExifTool'"

After installation, you will have the exiftool command available in /usr/bin or /usr/local/bin. To view the EXIF metadata in an image, just past the image as an argument to exiftool.

exiftool dsc_0790.jpg

Here is a snippet of the output from the above command:

ExifTool Version Number : 7.60
File Name : dsc_0790.jpg
Directory : .
File Size : 4.4 MB
File Modification Date/Time : 2008:07:16 09:45:20-07:00
File Type : JPEG
MIME Type : image/jpeg
Exif Byte Order : Big-endian (Motorola, MM)
Make : NIKON CORPORATION
Camera Model Name : NIKON D200
Orientation : Horizontal (normal)
X Resolution : 300
Y Resolution : 300
Resolution Unit : inches
Software : Bibble 4.10a
Modify Date : 2007:06:23 22:00:14
Exposure Time : 1/40
F Number : 2.0
Exposure Program : Aperture-priority AE
ISO : 100
.
.
.

ExifTool has many options for editing and removing EXIF metadata in images. To see the available options, use the --help switch or read the ExifTool documentation.

exiftool --help

Reading EXIF Metadata with Jhead

Jhead is a command line tool for displaying EXIF data embedded in JPEG images. On Fedora, use Yum to install Jhead:

su -c 'yum install jhead'

Now, use /usr/bin/jhead to read EXIF metadata:

jhead dsc_0790.jpg

Here is an example of the output produced by the jhead command:

File name : dsc_0790.jpg
File size : 4654488 bytes
File date : 2008:07:16 09:45:20
Camera make : NIKON CORPORATION
Camera model : NIKON D200
Date/Time : 2007:06:23 22:00:14
Resolution : 3880 x 2608
Flash used : No
Focal length : 50.0mm (35mm equivalent: 75mm)
Exposure time: 0.025 s (1/40)
Aperture : f/2.0
ISO equiv. : 100
Exposure bias: 1.00
Whitebalance : Auto
Exposure : aperture priority (semi-auto)
GPS Latitude : ? ?
GPS Longitude: ? ?
======= IPTC data: =======
(C)Flag : 0
DateCreated : 20070623
Time Created : 220014
Record vers. : 4

Removing EXIF Metadata with ImageMagick

If you need to strip the EXIF metadata from images, use ImageMagick's mogrify command. To install ImageMagick on Fedora, use Yum:

su -c 'yum install ImageMagick'

After ImageMagick is installed, you will have /usr/bin/mogrify available. The mogrify command can be used to strip Exif data from images.

mogrify -strip imagename.jpg

If you need to process a large number of files, use find and xargs:

find ./folder_of_images -name '*.jpg' | xargs mogrify -strip

Fedora 10 MP3 Support

Fedora 10 does not come with built-in MP3 support. To get MP3 support with Fedora, you can use RPM Fusion's YUM repositories to download MP3 enabled RPMs.

Enable RPM Fusion

First, install RPM Fusion's free and nonfree YUM repositories. For detailed information about installing RPM Fusion, see: http://rpmfusion.org/Configuration

su -c "rpm -Uvh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm"

su -c "rpm -Uvh http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm"

Install GStreamer

Next, run this command to get the gstreamer plugins.

su -c "yum install gstreamer gstreamer-plugins-bad gstreamer-plugins-ugly"

Install Applications and Libraries

For Amarok with MP3 support, install these packages:

su -c "yum install amarok phonon-backend-gstreamer"

For MPlayer with MP3 support, install these RPMs:

su -c "yum install mplayer gnome-mplayer gnome-mplayer-common mencoder"

For XMMS with MP3 support, install the following:

su -c "yum install xmms xmms-mp3"

For xine with MP3 support, install these RPMs:

su -c "yum install xine xine-lib-extras-nonfree"

To create MP3s with LAME, install lame and lame-mp3x.

su -c "yum install lame lame-mp3x"

Alternatively, run this command to install everything:

su -c "yum install xmms xine mplayer amarok xmms-mp3 gstreamer phonon-backend-gstreamer gstreamer-plugins-bad gstreamer-plugins-ugly xine-lib-extras-nonfree mplayer gnome-mplayer-common mencoder gnome-mplayer lame lame-mp3x"

Linux Wallpapers

Here are some of my favorite Linux Wallpapers (by various Flickr artists).



Fedora 9 MP3 Support

Fedora 9 does not release native support for MP3, so you need to get the right bits from another source like rpm.livna.org. First, install Livna's release package for Fedora 9. This will provide you with access to Livna.org's Fedora 9 YUM repository using /etc/yum.repos.d/livna.repo.

rpm -ivh http://rpm.livna.org/livna-release-9.rpm

Now, for XMMS MP3 support, install xmms and xmms-mp3

yum install xmms xmms-mp3

For Amarok MP3 support, install amarok and amarok-extras-nonfree.

yum install amarok amarok-extras-nonfree

For xine with MP3 support, install xine and xine-lib-extras-nonfree

yum install xine xine-lib-extras-nonfree

To create MP3s with LAME, install lame and lame-mp3x

yum install lame lame-mp3x

Syndicate content