forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 modpack by Stramm => Topic started by: nickfzx on October 14, 2007, 09:16:52 pm

Title: turn off compression of images when no intermediate image is created
Post by: nickfzx on October 14, 2007, 09:16:52 pm
In my gallery I have "Quality for JPEG files" set to 70

I have "Max width or height of an intermediate picture/video" set to 600

I would like to have it so that when an image is uploaded that is under 600x600 and therefore does not have any intermediate image created that the original image is used and not compressed.

Any help would be fantastico  ;D
Title: Re: turn off compression of images when no intermediate image is created
Post by: Nibbler on October 14, 2007, 09:36:05 pm
This already happens.
Title: Re: turn off compression of images when no intermediate image is created
Post by: nickfzx on October 14, 2007, 09:42:55 pm
not on my gallery...this maybe due to me having the modpack installed and sharpening set to thumbnails and intermediate images

gif images seem to be converted and compressed to jpg images as well

attached is an example before and after upload
Title: Re: turn off compression of images when no intermediate image is created
Post by: Nibbler on October 14, 2007, 09:49:39 pm
Coppermine doesn't convert image formats either, so this must be modpack question.
Title: Re: turn off compression of images when no intermediate image is created
Post by: nickfzx on October 14, 2007, 09:52:29 pm
ok so shall I start a topic in the modpack forum?
Title: Re: turn off compression of images when no intermediate image is created
Post by: Nibbler on October 14, 2007, 09:54:25 pm
I already moved this one. Continue here.
Title: Re: turn off compression of images when no intermediate image is created
Post by: Stramm on October 14, 2007, 09:54:36 pm
sharpening only is possible for thumbs. If you sharpen intermediate images, then you have hanged code.

The modpack needs ro recompress original / fullsized images when you watermark them. Turn off watermarking then.
Title: Re: turn off compression of images when no intermediate image is created
Post by: nickfzx on October 14, 2007, 10:00:21 pm
hey stramm, yep I have watermarking off already

the only hack I have done is this that you actually gave me:

in util.php find
Code: [Select]
                if (resize_image($work_image, $normal, $CONFIG['picture_width'], $CONFIG['thumb_method'], $CONFIG['thumb_use'], $watermark)) and replace with
Code: [Select]
                if (resize_image($work_image, $normal, $CONFIG['picture_width'], $CONFIG['thumb_method'], $CONFIG['thumb_use'], $watermark, 1))
apart from that I don't think I've hacked anything else in the upload process.

is it this hack that is causing gif's be converted to jpeg?
Title: Re: turn off compression of images when no intermediate image is created
Post by: Stramm on October 14, 2007, 11:15:46 pm
it sharpens the intermediate image... means it will be recompressed
Undo that modification and see what happens. With my version I can not reproduce what you reported
Title: Re: turn off compression of images when no intermediate image is created
Post by: nickfzx on October 14, 2007, 11:30:18 pm
ok I have found what is doing this

there is an option in config called:

"Auto resize images that are larger than max width or height"

if this is set to Yes then the image is converted to a jpeg everytime and if it is set to no then the original is kept intact

I don't know exactly what this option does, after reading the docs on this option ( http://coppermine-gallery.net/demo/cpg14x/docs/index.htm#admin_picture_thumbnail ) i still can't really understand exactly what it does.

As this option is not part of the modpack I think that it is not a problem with the modpack.