Image scaling bug since 1.52


#1

Hi,

I’ve now correctly compiled Juce 1.52 under Windows as a DLL, but images don’t seem to be scaled the same way as before anymore. The behaviour is actually different between Mac and Windows. The same problem happens when using the Jucer directly without any of our code. Here are two screen shots, one for each platform from the exact same build. What I’m doing is creating a small PNG image that I scale vertically or horizontally based on the window size to create a nice dynamically scalable bezel. I also attached one of those resized images. It seems that when an image is resized on Windows, the edges are feathered out and this gets worse as the scale factor increases. On Mac this isn’t the case.

Any idea what might be causing this? Thoughts about a possible quick fix?

Thanks,

Geert

[attachment=2]Mac Image Scaling.png[/attachment]

[attachment=1]Windows Image Scaling.png[/attachment]

[attachment=0]BackgroundBoxB.png[/attachment]


#2

Weird… If you can give me some code to reproduce it, I’ll sort it out.


#3

Hi Jules,

Thanks for the help, I attached a Jucer generated file with its resources. If I open this up in the recent Jucer, you can see the problem with the textBoxT, textBoxInner and textBoxB files. Their left and right edges are stretched and their top and bottom edges have some kind of 1px transparency.

Take care,

Geert


#4

Ah… looks like you’ve found a fundamental flaw in my image resizer… When it anti-aliases the edges of the image, the anti-aliasing gets scaled along with the source pixels rather than the destination pixels. I’d never noticed it before because it’d only be visible when you scale something up by a large factor, and put it over a constrasting background - which is exactly what you’re doing!

Ok, I’m on the case, will sort it out right now!


#5

Cool! Thanks for being on top of things :slight_smile:


#6

All checked-in now.