It is also able to reduce the size of digital camera JPEGs without loss of information, by deleting integral thumbnails that digital cameras put into the Exif header.
If you need to add Exif support to a program, this is a simple program to cut and paste from. Many projects, including PHP, have reused code from this utility.
Things jhead can extract from an Exif jpeg file
- Time and date picture was taken
- Camera make and model
- Integral low-res Exif thumbnail
- Shutter speed
- Camera F-stop number
- Flash used (yes/no)
- Distance camera was focused at
- Focal length and calculate 35 mm equivalent focal length
- Image resolution
- GPS info, if stored in image
- IPTC header
- XMP data
- Up-right images according to rotation tag using jpegtran
- Set or relative adjust internal exif timestamps
- Fix date / time offsets in large batches of images
- Re-name or date stamp files according to exif timestamp
- Transfer exif headers between images
- Replace thumbnails inside Exif headers
- Edit jpeg comments (but not the Exif comments)
- Delete exif or comment sections from jpeg images
- Create new minimal exif header containing date and thumbnail
The files coming out of a pretty much all Digital cameras are in the Exif flavour of Jpeg files. Exif files are for the most part Jpeg files, but start with a different header block, and contain additional data sections with camera settings, as well as a preview thumbnail picture as part of the Exif header. Many image browsers today make use of this integral thumbnail when browsing, while other browsers make their own thumbnails based on the image as a whole.
Because I am interested in photography, I am always curious just exactly what settings my fully automatic digital camera actually did end up using. Back in 1999, when I originally wrote jhead, I couldn't find a program that would consistently display the settings, nor one that could be compiled into a simple executable. I have since added many more features to jhead, many of them the result of suggestions or code contributions.
Though there are many programs out there now that can maniuplate Exif heders today, for many tasks, jhead remains the simplest and most effective tool for the job, especially if used for automated or scripted tasks.
Sample jhead output:
File name : 0805-153933.jpg
File size : 463023 bytes
File date : 2001:08:12 21:02:04
Camera make : Canon
Camera model : Canon PowerShot S100
Date/Time : 2001:08:05 15:39:33
Resolution : 1600 x 1200
Flash used : No
Focal length : 5.4mm (35mm equivalent: 36mm)
CCD Width : 5.23mm
Exposure time: 0.100 s (1/10)
Aperture : f/2.8
Focus Dist. : 1.18m
Metering Mode: center weight
Jpeg process : Baseline
The program also has a lot of other command line options for manipulating Exif files, such as options to manipulate the date in the header, renaming image files, or coordinating running Jpegtran and Mogrify to manipulate whole directory trees of images.
Here's the program files. Just right click and save as. The source archives should end in .tar.gz (as in jhead-2.7.tar.gz). Windows browsers have the annoying habit of renaming files on saving, so you may have to rename the file back to what is shown for programs to recognize them properly. You can use WinZip to open .tar.gz files.
For novice Linux/Unix/OS-X users: Don't forget to set the executable bit after downloading the pre-built executables. Type "chmod +x jhead" at a shell window after downloading it to do this.
I don't at this point have an OS-X machine to build the binary on, nor do I have a RedHat system to build the RPM for that anymore. Until somebody builds it for me for those platforms, just use the previous release - it works just fine.
Head revision (source only):
Releases
Current release version: 2.87 (Mar 2 2009)
Source tarball
jhead-2.87.tar.gz
(62 k)
Pre-built Windows executable
jhead.exe
(110 k)
Pre-built Linux executable (built on Ubuntu)
jhead
(69 k)
Pre-built OS-X Intel executable
jhead
(74 k)
Pre-built freebsd executable
jhead
(58 k)
Older Versions
Source tarballs
jhead-2.86.tar.gz
(62 k)
jhead-2.84.tar.gz
(64 k)
jhead-2.8.tar.gz
(61 k)
jhead-2.7.tar.gz
(59 k)
There's also a change log
The software is public domain. A program this small is not worth bothering restricting anybody with, and I'm too lazy to look into the ramifications of GPL or BSD licenses. Besides, I hope more people integrate this sort of functionality into their programs, free or not free.
I originally got my information on the Exif format from:
http://park2.wakwak.com/~tsuruzoh/Computer/Digicams/exif-e.html
If you liked this article, subscribe to the feed by clicking the image below to keep informed about new contents of the blog:
0 comments:
Post a Comment