coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: Loki66 on September 12, 2007, 01:25:27 AM

Title: Intermediate pictures bad quality
Post by: Loki66 on September 12, 2007, 01:25:27 AM
Hello,

The quality of the intermediate pictures is very bad - I tried ImageMagick and GD with the same result.

I have put the quality to 80 (work well usually) then 100 ...

http://faerie.monstrous.com/gallery/index.php

Please advise,

LK
Title: Re: Intermediate pictures bad quality
Post by: Nibbler on September 12, 2007, 01:42:20 AM
It's not bad quality - it's the wrong size and is being stretched to fit. Something is wrong/misconfigured with the theme you are using. Put the quality back down to 80 or you will eat your users' bandwidth. Also, what dimensions did you set for the intermediate image in config?
Title: Re: Intermediate pictures bad quality
Post by: Loki66 on September 12, 2007, 10:38:04 AM
I put the size to 275 and then tried to decrease it but it does not seem to change ....

How can I fix that with the template ?

Thanks,

Loïc
Title: Re: Intermediate pictures bad quality
Post by: Nibbler on September 12, 2007, 10:43:39 AM
Change the dimensions to max height and 420. Then rebuild your intermediate images and maybe thumbs too in config. If you don't want to do that then search the board for andreas09 and read up on how the theme changes the intermediate image size.
Title: Re: Intermediate pictures bad quality
Post by: Loki66 on September 12, 2007, 11:08:13 AM
"To correctly display large intermediate images, I've change the function compute_img_size($width, $height) to resize any intermediate image larger than 420 pixels wide. This will keep the auto scroll bar from appearing on monitors or window sizes of 800 pixels wide. If you want it to be larger, change "$max = 420;" in this function."  in the readme of that nice theme.

I am no programmer but I think that new function is buggy. I remove the following lines in the theme.php and it seems to work. Let me know if it is the right thing to do !

Thanks,

Loïc




/* Image scaled version
* Uses new function: compute_img_size_max() to set max intermediate image size for narrow themes
*/

----------------------------------------------------------------


function compute_img_size_max($width, $height)
{
         global $CONFIG;
        $thumb_use=$CONFIG['thumb_use'];
        $max = 420;
        if($thumb_use=='ht') {
          $ratio = $height / $max;
        } elseif($thumb_use=='wd') {
          $ratio = $width / $max;
        } else {
          $ratio = max($width, $height) / $max;
        }
        if ($ratio > 1.0) {
                $image_size['reduced'] = true;
        }
        $ratio = max($ratio, 1.0);
        $image_size['width'] = ceil($width / $ratio);
        $image_size['height'] = ceil($height / $ratio);
        $image_size['whole'] = 'width="'.$image_size['width'].'" height="'.$image_size['height'].'"';
        if($thumb_use=='ht') {
          $image_size['geom'] = ' height="'.$image_size['height'].'"';
        } elseif($thumb_use=='wd') {
          $image_size['geom'] = 'width="'.$image_size['width'].'"';
        } else {
          $image_size['geom'] = 'width="'.$image_size['width'].'" height="'.$image_size['height'].'"';
        }



        return $image_size;
}
Title: Re: Intermediate pictures bad quality
Post by: Loki66 on September 12, 2007, 11:10:21 AM
Now it seems that I cannot click and get the original pictures :-(
Title: Re: Intermediate pictures bad quality
Post by: Stramm on September 12, 2007, 07:44:55 PM
cause the orig pictures are smaller in size that the values you've set for intermediate images. If intermediate would be clickable you'd show the same pic again as fullsized pic.
Title: Re: Intermediate pictures bad quality
Post by: Loki66 on September 17, 2007, 01:57:34 PM
No the original pictures are larger, maybe it is resizing the thumbs instead of the originals ??
Title: Re: Intermediate pictures bad quality
Post by: Joachim Müller on September 17, 2007, 06:12:10 PM
Post a link to your gallery for a start. The URL you posted in your original posting doesn't point to a coppermine-driven gallery.