Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
becki:linux:graphics_processing [2011-09-06 09:29] becki created |
becki:linux:graphics_processing [2019-11-06 09:45] (aktuell) becki [Set the Exif create timestamp] |
||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
====== Graphics Processing == | ====== 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 [[http://www.sentex.net/~mwandel/jhead/usage.html|here]]. | jhead is available at www.slackbuilds.org. The manual for jhead is [[http://www.sentex.net/~mwandel/jhead/usage.html|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 [[https://www.exiv2.org/tags.html|tags]] | ||
+ | ===== Rename files and set file timestamps according to the Exif create timestamp == | ||
+ | |||
+ | exiv2 -t mv *.jpg | ||
===== Read all Exif Data == | ===== Read all Exif Data == | ||
+ | exiv2 image.jpg | ||
jhead image.jpg | jhead image.jpg | ||
php -r 'print_r(exif_read_data("image.jpg"));' | php -r 'print_r(exif_read_data("image.jpg"));' | ||
- | ===== Adjust Time == | + | ===== Adjust Exif Timestamp == |
+ | |||
+ | <code bash> | ||
+ | # Add one hour to the timestamp: | ||
+ | exiv2 -a '+01' adjust *.jgp | ||
+ | # Sub 30 minutes from the timestamp: | ||
+ | exiv2 -a '-00:30' adjust *.jgp | ||
+ | </code> | ||
+ | |||
+ | ==== old == | ||
jhead -da <to_time>-<from_time> *.jpg | jhead -da <to_time>-<from_time> *.jpg | ||
Zeile 18: | Zeile 41: | ||
===== Get Image Dimensions == | ===== Get Image Dimensions == | ||
+ | identify image.jpg [...] | ||
php -r 'print_r(getimagesize("image.jpg"));' | php -r 'print_r(getimagesize("image.jpg"));' | ||
rdjpgcom -verbose image.jpg | grep 'JPEG image' | rdjpgcom -verbose image.jpg | grep 'JPEG image' | ||
Zeile 33: | Zeile 57: | ||
jhead -cl 'comment text' image.jpg - Insert Comment directly | jhead -cl 'comment text' image.jpg - Insert Comment directly | ||
+ | ===== Delete comment == | ||
+ | |||
+ | exiv2 --Modify "del Exif.Photo.UserComment" *.jpg | ||
===== Rotate an Image == | ===== 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: | 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 | jpegtran -rotate 90 -copy all in.jpg > out.jpg | ||
- | |||
===== Resizing == | ===== Resizing == | ||
- | Alle Bilder im Verz auf 1600px als größte Dimension scalieren, wobei das Seitenverhältnis erhalten bleibt, Origiale werden zersört! Exif-header bleibt erhalten (ausprobiert), wobei der Resolution-Tag auf die neue Auflösung angepaßt wird: | + | 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 1600x1600 *.jpg | + | 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(!): | Alle Bilder im Verz auf eine Fläche von 10000 Pixel skalieren, wobei das Seitenverhältnis erhalten bleibt, Origiale werden zerstört(!): |