Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Blurry thumbnails - incorrect dimensions  (Read 4064 times)

0 Members and 1 Guest are viewing this topic.

neil fitzgerald

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 26
Blurry thumbnails - incorrect dimensions
« on: April 25, 2009, 03:20:50 am »

This issue seems to have resurfaced. http://forum.coppermine-gallery.net/index.php?topic=53320.0
Some (but not all) thumbnails are getting incorrect dimensions from Coppermine (e.g. 99x150px in the HTML, when I have made them all myself at 100x150).

My site: http://www.neilfitzgeraldphoto.co.nz/gallery/thumbnails.php?album=lastup&cat=0, currently cpg 1.4.21.

Suggestions appreciated very much.
Neil.
Logged

neil fitzgerald

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 26
Re: Blurry thumbnails - incorrect dimensions
« Reply #1 on: April 30, 2009, 01:08:28 am »

Is nobody else experiencing this problem?
Logged

Joe Carver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1510
  • aka 'i-imagine'
    • Home Page
Re: Blurry thumbnails - incorrect dimensions
« Reply #2 on: April 30, 2009, 01:23:32 am »

The answer is in the original post
EDIT: Looks like there were changes in the 3.x line (http://www.actsofvolition.com/archives/2006/december/scalingimages).  Hmm...  Regardless, this appears to be a Firefox "problem" and not Coppermine.

EDIT2: After some Googling, turns out the FF 3.x line switched to the Cairo graphics library


Are you concerned about the size only?  What image converter have you selected and what about the quality you have set in admin? Have you tried changing those settings? Have your tried the resizing tool in the admin menu? Or...did you resize and rename these and upload them as _thumbs? Run the version check to make sure your functions.inc.php got the upgrade too, because the code change mentioned in that post is in the newest version.


p.s. It does seem to be an artifact only on FF and SeaMonkey they weren't resized in Opera and IE. And yes, some of my thumbs are also showing the same behavior in FF but I can't see the difference until I look at the properties  :)
« Last Edit: April 30, 2009, 08:14:47 am by Joachim Müller »
Logged

neil fitzgerald

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 26
Re: Blurry thumbnails - incorrect dimensions
« Reply #3 on: May 03, 2009, 11:28:13 am »

It is not a problem only with FF, as was concluded at the end of that thread I linked to. It is obvious in FF because it seems to do a poor job of the resize. FF (3), IE (6,7, 8), and Safari all suffer. The source code read by all of these is telling the browsers to draw the thumbnails 99x150 px, when they are actually 100x150, so it is not the fault of any browser. I made them 100x150 in photoshop and uploaded them myself. If you save a thumbnail off my site and check the dimensions locally you will see it is 100x150, not 99x150 as coppermine is telling browsers. That 1 px makes a big difference.

Versioncheck suggests all is ok. I even downloaded functions.inc.php from my site to manually check the code was still the same.

« Last Edit: May 03, 2009, 04:37:51 pm by Joachim Müller »
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Blurry thumbnails - incorrect dimensions
« Reply #4 on: May 03, 2009, 12:43:42 pm »

instead of (compare the thread you quoted)
Code: [Select]
        $image_size['width'] =  (int) ($width / $ratio);
        $image_size['height'] = (int) ($height / $ratio);
try
Code: [Select]
        $image_size['width'] =  round ($width / $ratio);
        $image_size['height'] = round ($height / $ratio);

The initial ceil solution always returned the next highest integer value, so if width/ ratio is eg. 99.3, it resulted in 100 when the desired return vale is 99. Using int always cuts off everything after the dot. In your case 99.9 becomes 99. Not the desired value we need. Using round does a true round. 99.3 results in 99, 99.9 (your case) will become 100. So I think that should be a good solution in most environments.

neil fitzgerald

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 26
Re: Blurry thumbnails - incorrect dimensions
« Reply #5 on: May 04, 2009, 10:22:20 am »

That's fixed it, and I've learnt a little of php!
Thank you!! ;D
Logged
Pages: [1]   Go Up
 

Page created in 0.019 seconds with 20 queries.