Changing compression on thumbnails.

neilcreek

Joined: 2002-09-05
Posts: 52
Posted: Tue, 2002-10-01 00:56

I'm using NetPBM to generate my thumbnails, and I was wondering if there is a way to set the compression applied to the thumbnail images? Currently they're all jpegs at about 10-15k. This is quite weighty and consumes a lot of bandwidth. I'd much rather they be 3-7kb each instead. Is there a way to set the compression of NetPBM generated thumbnails?

Thanks :smile:

 
neilcreek

Joined: 2002-09-05
Posts: 52
Posted: Wed, 2002-10-02 06:13

Surely this is an important issue with large galleries and small bandwidth limits? Can anyone please help?

 
rogersi

Joined: 2002-10-01
Posts: 2
Posted: Wed, 2002-10-02 11:45

After a quick search in the sources it seems that resize_image in utils.php is the function you're after - it's called by makeThumbnail in classes/AlbumItem.php (and elsewhere probably)

Try editing the source so resize_image takes an optional "quality" fourth argument and update the the pnm calls appropriately.

I'm sure the Gallery authors would be grateful to see your patch :smile:

Not sure I've helped much, just some thoughts off the top of my head.

Ian.

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7985
Posted: Wed, 2002-10-02 17:55

You must have a pretty old version of Gallery. Starting in v1.2.6, you can specify the quality for JPEGs on page 2 of the config wizard.

 
neilcreek

Joined: 2002-09-05
Posts: 52
Posted: Thu, 2002-10-03 01:21

Doh! You've caught me out there! v1.2.5 :sad:
Looks like I'll have to go ahead with the upgrade I've been putting off! Thanks for your help!