lossless editing of jpeg pictures

Registered by Gianfranco Marino on 2009-06-12

Lossless cropping of jpeg pictures, see http://jpegclub.org/losslessapps.html or http://sylvana.net/jpegcrop/jpegtran/

Use jpegtran and support different operations: such as rotate, mirror, crop, ... Do it all in one action "Lossless JPEG" and use get_relevant_field_labels(self)() to show/hide conditionally (see eg save action) the necessary parameters (see other actions for inspiration).

Take the copy action as a starting point as this will not work with pil, it will work on the source file or on the last saved file. Both can be referenced with info['path'] Use subprocess.call('jpegtran ...',shell=True)

Blueprint information

Juho Vepsäläinen
Series goal:
Accepted for 0.2
Milestone target:
milestone icon 0.2.1
Started by
Stani on 2009-06-15
Completed by
Stani on 2009-06-22

Related branches



Juho, 13-6-2009 Would it be alright to use exiftran (http://pwet.fr/man/linux/commandes/exiftran) instead of jpegtran? It's part of fbida (http://linux.bytesex.org/fbida/). Compared to jpegtran it also handles exif data besides just lossless editing. I have not used either of the utilities though. :)

exiftran appears to be provided with many Linux distributions so it should be relatively easy to install. I'm not so sure about other platforms.

Stani 13-6-2009
As Phatch is cross platform we need to use tools which are available at least also on Windows. So please check that. In case exiftran is cross platform and jpegtran is linux only, there would be no visible change for the user. On linux we would use exiftran, but on Windows jpegtran. Also check if exiftran/jpegtran are present and raise an error if not. See the init method in core/lib/libtiff.py But for the user the action is called "Lossless JPEG" and the parameters should be the same. For the crop action follow the fields of the other crop action, for the rotation also and so on ... The only difference is that here it should be bundled all in one action and that all parameters show up conditionally.

Stani 17-6-2009
Use Imagemagick action as template. Use jpegtran as fallback for exiftran and for cropping.

Juho 17-6-2009
As the tool options differ a bit I left them as separate options so the user can explicitly use the tool he wants. If needed I can change the behavior.


Work Items

This blueprint contains Public information 
Everyone can see this information.


No subscribers.