Open Bug 807236 Opened 12 years ago Updated 2 years ago

inconsistent results scaling/resizing (large images to small)

Categories

(Core :: Graphics: ImageLib, defect)

19 Branch
x86_64
Windows 7
defect

Tracking

()

UNCONFIRMED

People

(Reporter: thornesa.we34, Unassigned)

References

()

Details

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Firefox/17.0
Build ID: 20121023124120

Steps to reproduce:

having followed bugs related to poor image quality for downsized images, like 795940 and 486918, I have been testing results of related changes that were made (which apparently adopted Chrome's image scaler?).  I have used various tests mentioned in other bugs, and seemingly got undesired results.  So to test it better, I built my own test case.


Actual results:

Some large images scale down as expected.  Others do not.  As I resize the window, images set to percentage of width rescale.  This tests when it works or does not.  Create a page with various images that seem suited for this.

I cannot tell what causes some to scale properly while others do not.


Expected results:

When these images resize, they should always do so with HQ results that make use of the new image scaling code.
Blocks: 795940
Note that some of these are simply because we don't support multiple downscales on the same page. That's bug 795072.
Two diff. version of the sphere and the other of the stairway all three are scaling as expected for me.  The downscaled tilted grid and car images are not
Specifics:
Six unique image files are displayed on the page, four JPEG, two PNG.  The two PNGs each have a corresponding JPEG.  Intended to see if image format effects this.

These are displayed as twelve image instances on the page. 10/12 scaled smaller, the other 2/12 full size, just for for comparison.

3/10 scaled versions are displaying and rescaling in HQ as expected (two JPEG, one PNG instances).  The other 7/10 scaled instances are not getting HQ scaling at all, even when resizing the window.
Depends on: 797632
No longer depends on: 797632
I have some advice for your test case. First off, as Joe Drew mentions, not being able to have multiple scalings of the same image is a different bug, so you should probably save that test for a different page. That way, we can have a single scaled image of the rotated chart to see if scaler itself is working. Every file on the page should only show up once so we know for sure that we're not running into Bug 795072.

Second, rather than having the full image, I think it would be better if you placed a properly scaled version of the image beside the images scaled by Firefox, so we can compare. This means you'd have to pre-scale the image with another program. And this image would have to be of a fixed size--you'd need to set this image to not be able to scale.

An obvious way to pre-scale the image would be to use cropped screenshots from Chrome. Since Firefox is using the same renderer as Chrome, the scaled image from Chrome is what the scaled image should look like in Firefox. 

If you're busy, I can do that last part for you (at the maximum scaling you provided), and upload the pre-scaled images as attachments. I would even losslessly optimize the PNGs. (Even if they were originally JPEGs, reencoding the scaled as JPEG would lose quality.)

BTW, your test should probably also include a GIF or two (one animated, one static.) (Scaled versions would still be PNGs). If Google won't let you upload GIFs for some reason, I have a free host that would be okay to use.

I'm looking forward to helping you test this, as I've been waiting for this feature for a long time.
  Good feedback. I wish to not duplicate bugs.
  When I opened this, I was not sure, but was thinking the unique behavior I am concerned about is not specifically reported elsewhere.
  It's more than just supporting multiple scaling requests (795072).  It's getting a variety of results for various images on a given page.  I can already get multiple images scaled correctly (seemingly satisfying 195072), but not necessarily every image on a page. E.g. some JPEGs rescale, others won't.  Is that your result too?
  Put full size versions for ref.  I guess they do not have to be there.

You are correct, revised test case could help. Maybe separate bugs for each image type (jpg, png, gif)?  So let's devise good test cases then.
Sorry I haven't gotten back to you. I had a whole thing typed up, but Firefox crashed, and I lost it, and then I forgot to come back and do it again. I'll just keep it short.

1. You need to only have one scaled image per page, or at least only one scaled image per image. And don't include the originals.

2. Oddly, if you load the car picture by itself, the scaling works. (Be sure to refresh it.) You can resize the window, and the image will update in a split second and look good. This is not the case with the skewed chart, however. (You can't tell easily until you shrink the window.) PNG vs. JPEG doesn't seem to matter.

3. The rest of the images look fine, as you said.

4. You didn't say if you wanted me to make properly scaled versions of the images. If we do that, you'll need to make the images a fixed size.

5. No reason to remove your other test--eventually it should work right.
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.