forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: pharaohweb on June 18, 2008, 05:40:47 am

Title: [Solved]: All thumbnails blurry... in Firefox v3.x only?
Post by: pharaohweb on June 18, 2008, 05:40:47 am
Hey all,

Love CPM, been using it for a long time with absolutely no issues.  Recently, however, it seems like my thumbnail images are rendering blurry in Firefox (they look fine in IE, haven't tested other browsers).  I haven't been studious enough to know for sure, but I think this may be an artifact of Firefox 3.x releases (I've been using the beta prior to today's release, and started noticing the blurriness sometime around first installing it... I think...).   

Notes, in the spirit of full disclosure:

.

It's not just newly-created thumbs that are blurry, all my existing thumbs are now blurry - and it's only in Firefox!   Anyone else experiencing this, and have any ideas what's up?  Is there just some dummy setting that changed in FF which I'm missing?  ???

Here's a link to a thumbnail page on my gallery: http://pharaohweb.com/media/thumbnails.php?album=80 (http://pharaohweb.com/media/thumbnails.php?album=80).

Looking forward to some thoughts.  Take care.
Title: Re: All thumbnails blurry... in Firefox v3.x only?
Post by: Hein Traag on June 18, 2008, 08:10:04 am
Upgrade first. You are using  1.4.9 which is 9 versions old. Upgrade is mandatory, download 1.4.18 a.s.a.p.
Title: Re: All thumbnails blurry... in Firefox v3.x only?
Post by: pharaohweb on June 18, 2008, 08:25:59 am
Appreciate the response, and will upgrade eventually... but I doubt that's the issue (things worked fine before on 1.4.9).

In the meantime, if anyone else can confirm the Firefox 3.x behavior I'd love to hear about it.

Thx.
Title: Re: All thumbnails blurry... in Firefox v3.x only?
Post by: Stramm on June 18, 2008, 08:27:10 am
Upgrading is not an option... it's mandatory!
Title: Re: All thumbnails blurry... in Firefox v3.x only?
Post by: pharaohweb on June 18, 2008, 08:39:24 am
Oookaaay guys... I get it.

But since no one is at my door with 1.4.18 burned on a CD and pointing a gun... I wouldn't call it "mandatory."

I'll upgrade tonight; and the question about Firefox 3.x still stands.
Title: Re: All thumbnails blurry... in Firefox v3.x only?
Post by: Stramm on June 18, 2008, 08:45:43 am
excellent... and virtually not just one person is standing in front of your door with a gun but hundreds with nasty code in front of your server door.
Title: Re: All thumbnails blurry... in Firefox v3.x only?
Post by: pharaohweb on June 18, 2008, 08:50:07 am
Thanks.  I understand the risks of running exploitable code, just hadn't chosen to upgrade yet.  Two more megs of upload and we'll see if 1.4.18 resolves the issue :)

EDIT: Successful upgrade to 1.4.18 and thumbs still blurry in Firefox.  If anyone has thoughts, please let me know.  Thanks.
Title: Re: All thumbnails blurry... in Firefox v3.x only?
Post by: Hein Traag on June 18, 2008, 08:58:52 am
Downloaded and installed FF3 yesterday but did not visit a cpg site with it. Can check tonight. Or someone else can do a check before that time.
Title: Re: All thumbnails blurry... in Firefox v3.x only?
Post by: pharaohweb on June 18, 2008, 09:01:13 am
Appreciate it.  As you likely know, it's not the end of the world ;)

Just curious.  Take care.
Title: Re: All thumbnails blurry... in Firefox v3.x only?
Post by: Stramm on June 18, 2008, 09:31:26 am
I couldn't spot any problem...
Tested on a fresh XP installation with IE7 (left), FF3

Title: Re: All thumbnails blurry... in Firefox v3.x only?
Post by: Stramm on June 18, 2008, 09:38:58 am
on a second view... you're right.
Eg. here, the cartoons thumb http://okshowpics.com/free/index.php?cat=2
Thumb size 149px × 111px, html upscaled to 150px × 112px what makes it blurry in FF3. I guess you have set the thumb width to 150, aspect: max aspect?
Title: Re: All thumbnails blurry... in Firefox v3.x only?
Post by: pharaohweb on June 18, 2008, 04:37:46 pm
Interesting.  I get the same thing if I right-click properties on the image in FF3: "149px × 112px (scaled to 150px × 113px)."  IE shows only 150px x 113px with no mention of "scaling."  If I download the thumbnail with FF or IE and open it with an imaging app, it is indeed 149px x 112px - as Firefox reports. 

My "Max dimension of a thumbnail" setting in config is, and has been, 150px - so I don't know why it'd be an issue...

So, I have to conclude that, somehow, the "scaling" being done in FF is what's causing the blurriness.  Whereas IE, which is also scaling up to my max width of 150px, looks fine.

I'm off to look up if FF changed the way it scales stuff in 3.x.  I'll report back if I find anything.
Title: Re: All thumbnails blurry... in Firefox v3.x only?
Post by: Stramm on June 18, 2008, 05:13:33 pm
This is a custom thumb you uploaded yourself and that hasn't been created by coppermine respective the image library you use (I guess)? If so, create one that has the needed size of 150px width and retry.
Title: Re: All thumbnails blurry... in Firefox v3.x only?
Post by: pharaohweb on June 18, 2008, 05:31:57 pm
Nope, all the thumbs are Coppermine/ImageMagick-generated.

Looking at thumbs created as recently as last night to months back, all seem to be at the 149px x 112px size.
Title: Re: All thumbnails blurry... in Firefox v3.x only?
Post by: Nibbler on June 18, 2008, 05:37:23 pm
Can you test with GD2?
Title: Re: All thumbnails blurry... in Firefox v3.x only?
Post by: pharaohweb on June 18, 2008, 05:50:03 pm
OK, changed to GD2 on server-side and did a quick test-gallery.  Same blurry results in FF, looks OK in IE.  Here's the test thumbs, created with GD2 and CPG 1.4.18 just now: http://pharaohweb.com/media/thumbnails.php?album=88 (http://pharaohweb.com/media/thumbnails.php?album=88).

Thanks.
Title: Re: All thumbnails blurry... in Firefox v3.x only?
Post by: pharaohweb on June 18, 2008, 06:21:00 pm
For grins, I installed a Firefox 2.0.0.14 on a "virgin" XP machine (has never had a FF install previous).  The images look as sharp as IE (no blurriness), and no mention of "scaling" in the right-click properties (just shows 150px x 113px like IE). 

So, I've confirmed that, for me at least, this issue is directly related to FF3.x.

Still looking for info on how they may have changed image-scaling in the 3.x line.

EDIT: Looks like there were changes in the 3.x line (http://www.actsofvolition.com/archives/2006/december/scalingimages (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, and now does image scaling differently. As far as I can tell, this was done with intent to produce "smoother" or higher quality scaled images, but can have the opposite effect for smaller detailed images, particularly pixel-art & thumbnails.  There are plenty of folks online also talking about how smaller images are "blurry" when viewed with FF3.x (one example here: http://www.nivas.hr/blog/2008/04/08/firefox-3-beta-5-blurring-images/ (http://www.nivas.hr/blog/2008/04/08/firefox-3-beta-5-blurring-images/).  IMO this issue is "solved" as it never actually had anything to do w/CPG in the first place.  Thanks for the help, at least I got an upgrade out of it.  Now I just wait for the ability to turn off the FF3.x scaling feature.
Title: Re: [Solved]: All thumbnails blurry... in Firefox v3.x only?
Post by: neil fitzgerald on August 03, 2008, 08:16:58 am
I'm not so sure this isn't related to Coppermine.
I also noticed it began with FF3, but I wonder if it isn't simply revealing some other issue.
All my thumbnails are made manually (150 px max dimension).
Right-click > properties indicates Firefox is scaling all the blurry thumbnails, usually up one pixel on the short side compared with the actual size of the image (as uploaded or saved off the web page). Properties in IE gives the same dimensions as the scaled number in FF, so they are both scaling them but FF doesn't do such a good job of it.
The page source shows that the browsers are being given these wrong dimensions for the thumbnails (the value Firefox says "scaled to"). Could it be that Coppermine is returning the wrong short side dimension for thumbnails?


e.g. the first thumbnail on http://www.neilfitzgeraldphoto.co.nz/gallery/index.php?cat=17 (http://www.neilfitzgeraldphoto.co.nz/gallery/index.php?cat=17) displays at 150 x 107 px on FF3 and IE7 but actual image is 150 x 106 px.

I have bumbled my way through quite a few mods on my site so apologise if this is something I have unwittingly induced.
Title: Re: [Solved]: All thumbnails blurry... in Firefox v3.x only?
Post by: Nibbler on August 03, 2008, 12:44:13 pm
Can you see if running the 're-read image dimensions' in admin tools fixes it?
Title: Re: [Solved]: All thumbnails blurry... in Firefox v3.x only?
Post by: neil fitzgerald on August 03, 2008, 10:55:11 pm
Do you mean "Reload file dimensions and size information"? That didn't change anything.
Title: Re: [Solved]: All thumbnails blurry... in Firefox v3.x only?
Post by: neil fitzgerald on August 10, 2008, 07:07:12 am
Am I right that the thumbnail dimensions are not stored in the database (I couldn't see them)?
Also, I just noticed that thumbnails displayed by editpics.php are fine (not scaled). It looks to me like it is only thumbnails.php that causes the scaling error.
Does this provide any clues?
Title: Re: [Solved]: All thumbnails blurry... in Firefox v3.x only?
Post by: Joachim Müller on August 10, 2008, 08:22:50 am
Individual thumbnail dimensions indeed are not being stored in the database, but they are being calculated based on the original.
Title: Re: [Solved]: All thumbnails blurry... in Firefox v3.x only?
Post by: Nibbler on August 10, 2008, 05:21:10 pm
Edit include/functions.inc.php, find

Code: [Select]
        $image_size['width'] = ceil($width / $ratio);
        $image_size['height'] = ceil($height / $ratio);

Change to

Code: [Select]
        $image_size['width'] =  (int) ($width / $ratio);
        $image_size['height'] = (int) ($height / $ratio);
Title: Re: [Solved]: All thumbnails blurry... in Firefox v3.x only?
Post by: neil fitzgerald on August 11, 2008, 12:15:53 am
That has fixed it! Thanks guys ;D
Title: Re: [Solved]: All thumbnails blurry... in Firefox v3.x only?
Post by: Nibbler on August 11, 2008, 02:31:23 pm
Fixed in svn.