![]() |
|
Lossless jpeg rotation using jpegtran - Printable Version +- ZenphotoCMS Forum (https://forum.zenphoto.org) +-- Forum: Support (https://forum.zenphoto.org/forum-1.html) +--- Forum: General support (https://forum.zenphoto.org/forum-4.html) +--- Thread: Lossless jpeg rotation using jpegtran (/thread-7003.html) |
Lossless jpeg rotation using jpegtran - christue - 05-05-2010 First of all I want to thank the developers for this wonderful piece of software! I have been searching for a web gallery management tool and ZenPhoto is just what I was looking for... What I don't like very much is the way the auto-rotating feature of images works:
Has anyone already considered to implement this? Lossless jpeg rotation using jpegtran - acrylian - 05-05-2010 Well, I doubt that normal standard shared hosts where Zenphoto mostly is used provide something special like "jpgtran" (I never heard about before actually). Anyway, of course feel free to write a plugin or admin utility for your special needs. New third party plugins are always welcome. The new_image filter is surely the tool to use for this. Lets us know and we surely add an entry to our extensions section. Please read the contributor and developer guidelines before proceeding. Lossless jpeg rotation using jpegtran - christue - 05-05-2010 Acrylian, thanks for your answer. jpegtran is part of the Independent JPEG Group's software (libjpeg) which is used for jpeg support in many applications and should be available on almost every linux system (in Debian/Ubuntu, it is in the package libjpeg-progs). I believe that many image viewers use it for jpeg rotation. What makes jpegtran special is that it does not decompress the image, rotate it and then compress it again (loosing quality), but simply rotates the compressed image, so the jpeg image will not loose quality. That's why it could safely be hooked in to zenphoto right when importing images to rotate the ORIGINAL image. Of course, the image should only be rotated if the EXIF orientation value suggests this. And afterwards the EXIF orientation flag must be set to 1 so that the image will not be rotated again... I'm now working on a plugin for zenphoto that does the following things:
I hope to publish a first version soon... Lossless jpeg rotation using jpegtran - gjunk - 06-05-2010 Apolagize for this being slightly OT - but what if the exif data is missing or incorrect (which certainly happens). Is there a way for admin to request a rotation (for display purposes) Am I correct that rotations and edits are for display only and leave the original image intact ? Thanks!! gene Lossless jpeg rotation using jpegtran - sbillard - 06-05-2010 sometimes it is just best to look. If your PHP supports image rotation you will have that selection on the image edit tab. You can pick whatever rotation you wish. Only images that Zenphoto creates are rotated (the original is almost never touched. Just by the crop-image plugin and then with appropriate warnings.) Lossless jpeg rotation using jpegtran - christue - 06-05-2010 One question to the developers: When I have a _Image object, what would be the best practice to determine whether it is a JPEG image? I'm missing a function like $image->getType() that would return "image/jpeg". So do I have to check the extension of the filename? Lossless jpeg rotation using jpegtran - acrylian - 06-05-2010 We don't have a method for that. But the suffix should match the file type anyway so we have a convenient function to do this: If you need to get the mimetype But maybe sbillard has another answer as this core stuff is generally his resort. Lossless jpeg rotation using jpegtran - christue - 06-05-2010 Thanks acrylian, I now use
Lossless jpeg rotation using jpegtran - christue - 06-05-2010 OK, there's a first version of my first zenphoto plugin. There's currently no homepage for it, but the code can be fetched from Gitorious: http://gitorious.org/zenphoto-plugins/filter_jpegrotation_lossless What it does currently: Requirements:
Notes:
Not yet implemented:
Lossless jpeg rotation using jpegtran - acrylian - 06-05-2010 Would it be possible to add these notes on the gitorious page as well? Just asking as that is perfect for a plugin project page of course. I will create a entry on the extensions page for it linking to both urls for now. Lossless jpeg rotation using jpegtran - christue - 06-05-2010 I'm new to gitorious and didn't find a way to edit some text on the linked page... But now I found that I can create a wiki in my project there and so I put the plugin documentation to the following wiki page: http://gitorious.org/zenphoto-plugins/pages/Filter-jpegrotate-lossless Lossless jpeg rotation using jpegtran - christue - 06-05-2010 On the wiki page Lossless jpeg rotation using jpegtran - acrylian - 06-05-2010 Great, I was sure that must have been possible. The entry is up: http://www.zenphoto.org/2010/05/filter_rotation_lossless/ Lossless jpeg rotation using jpegtran - nehakakar - 21-10-2024 It's exciting to see efforts for lossless JPEG rotation in ZenPhoto! Using tools like https://jpegcompressor.com can also help optimize images without losing quality, making it easier to manage image files. |