views:

56

answers:

1

I had this question before "Resize image on the fly make the image lose quality online but locally works nice"

And what i got now is that it's not a problem of local or online, i ran this resize on the server itself "dedicated server", and i got the same bad quality image, so the problem is in the IIS configurations.

What in iis can make this bad quality image happen?

A: 

The issue here is inside the DynamicImage object.

This is the one that creates the image and send it.

Just find if this object have an option about the quality, or just use any other method to resize your image. Its really very simple to resize an image and the quality is change on this options

Graphics g

g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
g.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.HighQuality;
g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;

Some urls
http://www.glennjones.net/Post/799/Highqualitydynamicallyresizedimageswithnet.htm
http://www.codeproject.com/KB/web-image/pnguploader.aspx

Aristos
I am using my code in another place in the same website but without a handler, just by writing the image to the hard disk, and it's working perfect with good quality, So that's means that the problem is not in the resize code, it is something in the IIS configuration or the response.
Amr ElGarhy
I have no idea - but I wonder if it's some sort of compression mechanism? But if this was the case you'd think other images were also affected in the same way. Have you served other images via the handler - with excellent quality but not modified by your code?
Adrian K
@Amr The problem is on resize code. Its just take from somewhere the default quality when is going to use the Graphics object that is needed to create the image.
Aristos
Look, i used the same resize code but by writing the image to the disk then read from the file on another page, not using a handler or on fly resize, and it was working with good quality, but this one is not.
Amr ElGarhy
@Amr Why not get a clear code for resize the image and not use this black box ? Its really too simple, just 10 lines of code... maybe less. For this object that you use, if I have the dll that call it I will check it inside with NetReflector, but I do not have it.
Aristos