Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: Thumbnail img tag size is wrong sometimes  (Read 9428 times)

0 Members and 1 Guest are viewing this topic.

utgart

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Thumbnail img tag size is wrong sometimes
« on: November 11, 2010, 11:09:25 pm »

I use CPG 1.5.8, PHP 5.2.9, GD 2.0.34

I'm creating all sizes (thumb_*, normal_*, *) manually, and upload them by ftp.
After batch adding, IMG tag of some thumbnails have wrong short side size. When long side is always 200px, the short is 133px instead of 134, 134 instead of 135, etc. But when image proportions are not 2:3, then all is ok.
It can be seen here: http://radovar.kiev.ua/thumbnails.php?album=84: First thumb has wrong size, but sizes of second and third are correct.
Logged

utgart

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: Thumbnail img tag size is wrong sometimes
« Reply #1 on: November 11, 2010, 11:12:45 pm »

Forget the phrase about proportions. Sometimes size become wrong even when proportions are not 2:3.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Thumbnail img tag size is wrong sometimes
« Reply #2 on: November 12, 2010, 07:42:54 am »

Probably a difference in calculating the new dimensions. Shouldn't happen when thumbnails are created by Coppermine.
Logged

utgart

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: Thumbnail img tag size is wrong sometimes
« Reply #3 on: November 12, 2010, 08:45:17 am »

I agree with you, but in 1.4 it didn't happen. I think, 1.4 don't calculate thumbnail size but get it directly from thumbnail. But 1.5 calculates thumbnail size using large (or normal) image size (please correct me if I'm wrong). I think, the first method is better :)
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Thumbnail img tag size is wrong sometimes
« Reply #4 on: November 12, 2010, 09:24:19 am »

I think, 1.4 don't calculate thumbnail size but get it directly from thumbnail.
cpg1.4.x also calculated it. As far as I can see there's no difference in the calculation, unless you use 'exact' as thumb resizing method:
Code: (include/functions.inc.php) [Select]
$image_size = compute_img_size($row['pwidth'], $row['pheight'], $CONFIG['thumb_width']);
Code: (include/functions.inc.php) [Select]
    } elseif ($thumb_use == 'ex') {

        if ($normal == 'normal') {
            $image_size['geom'] = 'width="' . $image_size['width'] . '" height="' . $image_size['height'] . '"';
        } elseif ($normal == 'cat_thumb') {
            $image_size['geom'] = 'width="' . $max . '" height="' . ($CONFIG['thumb_height'] * $max / $CONFIG['thumb_width']) . '"';
        } else {
            $image_size['geom'] = 'width="' . $CONFIG['thumb_width'] . '" height="' . $CONFIG['thumb_height'] . '"';
        }
        //if we have a system icon we override the previous calculation and take 'any' as base for the calc
        if ($system_icon) {
            $image_size['geom'] = 'width="' . $image_size['width'] . '" height="' . $image_size['height'] . '"';
        }

    }
Logged
Pages: [1]   Go Up
 

Page created in 0.021 seconds with 20 queries.