Module: jpegtran <- lossless rotation

letic

Joined: 2011-12-23
Posts: 13
Posted: Fri, 2012-08-03 22:14

Hey guys,

I made a new enhanced version of the jpegtran plugin to learn how modules were working in gallery3 before trying more interesting stuff :)

It has an admin page that let you speficy the path of the executable, but will tries to auto configure itself if jpegtran is in the path.

I had a few questions for devs/potential users as well :
* Carlstreeter (who made version 1 of the plugin) overloaded the gallery_graphics_Core class. I thought that I could use the graphics_rotate event but according to my test it is not possible as it will call the underlying Image_Driver rotate function no matter what. Did I miss something ?
* I also wanted to implement the lossless resizing with jpegtran but unfortunately it only supports scaling by multiples of 2 (up to 16). Would anybody still have interest for such a feature ?
* Another possible feature is the use of the lossless optimisisation. By re-ordering the Huffman table jpegtran is able to reduce the size of jpeg by an average of 15% without any loss of quality. This could be implemented as a maitenance task for example to reduce the size of huge galleries...

Anyway these are just a few ideas.

Let me know what you think of the plugin.
Cheers
LeTic

PS : I removed the attachment as for some reason the tar.gz was corrupted when redownloading it. Other download links :
* Direct file download : https://projects.letic.fr/attachments/download/51/jpegtran.tar.gz
* Git repository : https://projects.letic.fr/projects/gallery3/repository/revisions/master/show/3.0/modules/jpegtran
* GitHub mirror : https://github.com/letic/gallery3-contrib/tree/master/3.0/modules/jpegtran

Edit :
* 12/05/2013 : Change links to version 3 with jnash/mikage's fix - Thanks guys !

 
mattdm

Joined: 2005-07-22
Posts: 181
Posted: Fri, 2012-08-03 23:03

Sounds good to me -- particularly, the optimize task.

I think the scaled images aren't supported by all viewers, and I'm not sure what web browsers that includes. Really probably not so useful.

One thing that is useful is converting to grayscale. If you could detect (using one of the other toolsets) images which are all grayscale but which happen to be encoded as full color, that's a nice "free" space gain.

 
hotman_x

Joined: 2013-04-24
Posts: 1
Posted: Wed, 2013-04-24 14:49

Maybe a bug:

When I'm on Chinese language, the rotation menu item do nothing. On English, it works well.

 
jnash
jnash's picture

Joined: 2004-08-02
Posts: 814
Posted: Sat, 2013-05-04 12:20

I'm working on another module and noticed an omission in the event calls from this module.

in your helpers/MY_gallery_graphics.php

on the function, $item is missing from the end of the input variables

-having this added to the input allows the following fix-

on the event triggers, $item is missing from the end

Adding these would keep it the same as the original gallery_graphics function and allow for item details to be passed along via the event

cheers

 
letic

Joined: 2011-12-23
Posts: 13
Posted: Sun, 2013-05-12 20:55

Hey jnash,

I wasn't sure what you meant but when I looked in the module's old github repository (it's moved since) I found a nice pull request with the fix from mikage.

I uploaded a new version 3 with the fix.

Thanks a lot for that !
LeTic

 
jnash
jnash's picture

Joined: 2004-08-02
Posts: 814
Posted: Sun, 2013-05-12 22:49

awesome, thanks!