NetPBM vs ImageMagick

jifl

Joined: 2003-07-06
Posts: 18
Posted: Sun, 2003-07-06 23:21

I had been going with the default settings of Gallery, which meant using NetPBM even though I had ImageMagick installed.

But by chance I've noticed that if you rotate an image, then netPBM will decompress and recompress the image lossily. In other words, if you rotate a picture several times you will lose quality. And it overwrites the original image so once you've rotated, it's gone :-|.

So if both are installed, why not make ImageMagick the default since jpegtran doesn't do a full decode/recode on rotation and isn't lossy? I couldn't find any perceptible difference in output quality, but there would definitely be drawbacks to rotating with NetPBM. At the very least it might be better to rotate using ImageMagick even if thumbnails/sized pics are done with NetPBM.

Just hoping to prevent other people not degrading their originals like mine were! :)

 
jifl

Joined: 2003-07-06
Posts: 18
Posted: Mon, 2003-07-07 02:44

Oops, I've just seen I wasn't right there - I thought jpegtran was part of ImageMagick but it isn't, and it doesn't appear to do lossless rotation either. So in that case, I suggest adding jpegtran as an option for doing rotation.

 
jifl

Joined: 2003-07-06
Posts: 18
Posted: Mon, 2003-07-07 03:52

Hmmm it's fun talking to myself :)

I decided I should just put my money where my mouth is and supply a patch to do it rather than get someone else to. I'm posting it over on the Customizing Gallery forum so hopefully someone can pick it up from there and integrate it into the Gallery 1.x tree.

Thanks!

 
alindeman
alindeman's picture

Joined: 2002-10-06
Posts: 8194
Posted: Mon, 2003-07-07 13:12

Yep, we're looking into using jpegtran, maybe for 1.3.5. Thanks for your patch. You might want to submit it as a patch on the SF.net page --> http://sf.net/projects/gallery (it's under Patches, IIRC)

 
jifl

Joined: 2003-07-06
Posts: 18
Posted: Mon, 2003-07-07 17:49

Thanks, I've done that!

 
alindeman
alindeman's picture

Joined: 2002-10-06
Posts: 8194
Posted: Mon, 2003-07-07 20:32

Implemented in 1.3.5-cvs-b46

 
kb7sei

Joined: 2003-07-29
Posts: 16
Posted: Tue, 2003-07-29 23:14

Is there any way to be sure that jpegtran is called when this happens instead of the old way? I applied the patch, but want to test it before rotating some images. The config stage worked perfectly.

 
alindeman
alindeman's picture

Joined: 2002-10-06
Posts: 8194
Posted: Wed, 2003-07-30 01:40

Put Gallery into debug mode (config wizard, step 2) and you'll see the actual command being executed.