Inhaltsverzeichnis

Graphics Processing

Slack now comes with exiv2 on board. This makes at least some of jheads features obsolete.

jhead is available at www.slackbuilds.org. The manual for jhead is here.

Set the Exif create timestamp

exiv2 --Modify "set Exif.Photo.DateTimeOriginal 2019:10:07 09:51:18" image.jpg

Useful mainly when the timestamp is missing (e.g. in images coming from Whatsapp).

List of the exif tags

Rename files and set file timestamps according to the Exif create timestamp

exiv2 -t mv *.jpg

Read all Exif Data

exiv2 image.jpg
jhead image.jpg
php -r 'print_r(exif_read_data("image.jpg"));'

Adjust Exif Timestamp

# Add one hour to the timestamp:
exiv2 -a '+01' adjust *.jgp
# Sub 30 minutes from the timestamp:
exiv2 -a '-00:30' adjust *.jgp

old

jhead -da <to_time>-<from_time> *.jpg

Example:

jhead -da 2011:09:04/21:17:04-2009:09:04/05:55:00 *.jpg

Get Image Dimensions

identify image.jpg [...]
php -r 'print_r(getimagesize("image.jpg"));'
rdjpgcom -verbose image.jpg | grep 'JPEG image'

Read comment

rdjpgcom image.jpg

Write comment

wrjpgcom [-replace] -comment 'comment text' image.jpg - Add/replace comment directly
wrjpgcom [-replace] -cfile comment.txt image.jpg - Add/replace comment with text from comment.txt
jhead -ce image.jpg - Insert comment with editor (eg. vim)
jhead -ci comment.txt image.jpg - Replace comment with text from comment.txt
jhead -cl 'comment text' image.jpg - Insert Comment directly

Delete comment

exiv2 --Modify "del Exif.Photo.UserComment" *.jpg

Rotate an Image

Bild verlustfrei um 90° im Uhzeigersinn drehen (-rotate 90) wobei Kommentare, exif-header & thumbnails erhalten bleiben. Die Resolution-Info wird automatisch angepaßt: zB 1600 x 1200 → 1200 x 1600:

jpegtran -rotate 90 -copy all in.jpg > out.jpg

Resizing

Alle Bilder im Verz auf 2048px als größte Dimension scalieren, wobei das Seitenverhältnis erhalten bleibt, Origiale werden zersört! Nur Bilder, die größer als 2048px werden verkleinert. FIXME Kleinere Bilder werden offenbar doch angefasst
Exif-header bleibt erhalten (ausprobiert), wobei der Resolution-Tag auf die neue Auflösung angepaßt wird:

mogrify -verbose -resize '2048x2048>' *.jpg

Alle Bilder im Verz auf eine Fläche von 10000 Pixel skalieren, wobei das Seitenverhältnis erhalten bleibt, Origiale werden zerstört(!):

mogrify -resize 10000@ *.jpg

-scale is faster as -resize, but quality is lower. mogrify is part of ImageMagick.

Convert Image File Format

A script to convert from one image file format to another:

#!/bin/bash
oldext=pcd
newext=jpg
command=convert
for file in *.$oldext ; do
    base=$(basename $file .$oldext)
    echo $command $base.$oldext $base.$newext
    $command $base.$oldext $base.$newext
done

convert is part of ImageMagick.

Get or remove embedded Thumbnails

jhead -st thub.jpg bild.jpg - Save Thumbnail in thumb.jpg
jhead -st "thumbnails/&i" *.jpg - Save thumbnails in subdir
jhead -dt *.jpg - Delete thumbnails

Image Viewers

gthumb kuickshow gqview → geeqie nview eog display seejpeg

display - CLI Image Viewer

space     display the next image
backspace display the former image
Ctl-D     delete an image file
Ctl+Z     undo last image transformation
<         halve the image size.
.         return to the original image size.
>         double the image size

xv - CLI Image Viewer

space     display the next image
backspace display the former image
Ctl-D     delete an image file

jigl.pl (obsolete?)

  1. uec –use-exif-comment
  2. it –index-title <string> - Sets the title and title-bar of the index.html page
  3. -nogenerate-info

Options: xome.net/projects/jigl/