Announcement

#1 2015-01-09 20:52:21

jc
Member
2015-01-04
26

How to repair bad rotated images (shell script to remove some EXIF)

Like some others i had a problem with bad rotated images. Piwigo and geeqie shows photos "to the side". When i removed EXIF Orientation tag from photo (1), it was good. So i found all rotated photos (by EXIF) and removed tag from photos in some directories.

Script that i used for tests is here: http://pastebin.com/KkUbLpPP
You need exif binary (exif package in my Debian).

(1) exif -t Orientation --remove -o "dest_file_or_same_file.jpg" "source_file.jpg"

Offline

 

#2 2015-02-09 14:15:40

jc
Member
2015-01-04
26

Re: How to repair bad rotated images (shell script to remove some EXIF)

Second script, which unrotate photo in argument not deleting Orientation EXIF tag, but overwriting it to top-left.

http://pastebin.com/9y2jWF57

It is possible to do things like:

find DIRECTORY -type f -iname "*.jpg" -exec foto-unrotate.sh {} \;

or even:

for I in DIR1 DIR2 DIR3; do find $I -type f -iname "*.jpg" -exec foto-unrotate.sh {} \;; done

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact