Comment 5 for bug 2023109

Revision history for this message
George-Andrei Iosif (iosifache) wrote :

Hello,

I research the current Jhead usage in the packages mentioned by @vorlon (only the versions present in Mantic):

- cthumb-4.2 (Reverse-Recommends)
    - General-purpose image analysis in cthumb:1238: jhead <image>
    - Date extraction in cthumb:1487: jhead $picname | grep "Date/Time"
    - Rotation in cthumb:1704

        my $cmd = "mogrify -rotate \"$destRotate\" -geometry \"${destWidth}x${destHeight}>\" -quality
        [..]
        my $new_cmd = "jhead -cmd '$cmd &i' $dest";

- dvd-slideshow-0.8.6.1 (Reverse-Recommends)
    - Taken time extraction in dir2slideshow:688: taken='jhead "$file" | grep 'Date/Time' | awk -F': ' '{print $2}''
    - Modified time extraction: modified='jhead "$file" | grep 'File date' | awk -F': ' '{print $2}'
- mapivi-1.2+svn356 (Reverse-Recommends)
    - Image autorotation in mapivi.pl:14444: $command = "jhead -autorot \"$dpic\" ";
    - Clearing the rotation flag in mapivi.pl:14453: $command = "jhead -norot \"$dpic\" ";
- jigl-2.0.1+20060126 (Reverse-Depends), in which all snippets above are followed by: jhead -cmd "jpegtran $cmdStr -outfile &o &i" $fileStr
    - Image flip using jpegtran, in rotate:92: set cmdStr = "-flip $argv[2]"
    - Image rotation using jpegtran, in rotate:120: set cmdStr = "-rotate $argv[2]"
    - Image transpose using jpegtran, in rotate:126: set cmdStr = "-transpose $argv[2]"
    - Image transverse using jpegtran, in rotate:132: set cmdStr = "-transverse"
- zoph-1.0.1 (Reverse-Depends)
    - Image rotation in base.inc.php: $cmd = "jhead -autorot " . escapeshellarg($file);

A replacement package/combination of packages needs to be capable of:

- General-purpose processing/manipulation of the Exif data (including taken/modified date, and Orientation);
- Image rotation; and
- jpegtran or mogrify invocation with a backup mechanism (i.e. no in-place modification, but over a temporary copy).

For Exif parsing, there already are packages like exiv2, exif, and exiftool. For the last two, jpegtran and mogrify could be called directly in the dependents' code, by only implementing the mentioned backup mechanism (if needed).