Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Web Server Affecting Images?

Status
Not open for further replies.

cbjroms

IS-IT--Management
Dec 7, 2004
7
GB
I have an application (VB.Net2) which takes an image (JPEG) file and resizes it.

I have tested this application by putting it into a local version of my website (which also contains local copy of my image library) hosted on my PC. The images shown on the web pages are crisp and clear.

But when I put this same version of the website (including image library) onto my remote webserver, the images shown on the served web pages are markedly pixallated (even in areas that are normally flat colour). I have downloaed the images from the image library to check them on my PC and they are fine.

Why should the website produce crsip/clear images when hosted locally yet grainy/pixallated images when hosted on a remote web server?

Thanks in anticipation.

Chris
 
Thanks for lookning at my question.

I am not a programmer and so don't really know how to answer your question.

I have had a DLL produced for me which does the resizing. The DLL allows me to select (from a range of options) the compositing quality, smoothing and interpolation mode.

You can see this in action at:
Test settings: width: 614, height: 340 , picture: homepic.jpg.

Thanks again.

Chris
 
In could be the way that the dll is performing the resize that is the issue. If you don't have access to the source code, there's probably not an awful lot we can do to help from an ASP.NET perspective.

I'd go back to where you purchased the dll from and ask for their support.


-------------------------------------------------------

Mark,
[URL unfurl="true"]http://aspnetlibrary.com[/url]
[URL unfurl="true"]http://mdssolutions.co.uk[/url] - Delivering professional ASP.NET solutions
[URL unfurl="true"]http://weblogs.asp.net/marksmith[/url]
 
Thanks again for the response.

I purchased both the DLL and its source code and am happy to upload if you would be willing to have a quick look.

I have spoken with the programmer who produced the DLL but he has little experience of the website/webserver end of things.

Thing is the application works fine when the website is hosted on a local PC which tends to suggest that it is something at the webserver end. Could it be anything to do with GDI settings?

Chris
 
If you provide the source code that does the resizing, we could take a look at that. Anything to do with server settings is outside the scope of this forum though.


-------------------------------------------------------

Mark,
[URL unfurl="true"]http://aspnetlibrary.com[/url]
[URL unfurl="true"]http://mdssolutions.co.uk[/url] - Delivering professional ASP.NET solutions
[URL unfurl="true"]http://weblogs.asp.net/marksmith[/url]
 
Code:
    Private Function ProcessImage(ByVal img_In As Image, ByVal size_Temp As Size)

        '*** Create a new image with the desired size
        Dim bmp_New As New Bitmap(size_Temp.Width, size_Temp.Height)
        Dim gfx As Graphics = Graphics.FromImage(bmp_New)

        '*** Set the drawing quality to the highest levels
        gfx.SmoothingMode = SmoothingMode.AntiAlias
        gfx.CompositingQuality = CompositingQuality.HighQuality
        gfx.InterpolationMode = InterpolationMode.HighQualityBicubic

        '*** Draw the old image to the new one
        gfx.DrawImage(img_In, New Rectangle(0, 0, size_Temp.Width, size_Temp.Height))

        '*** Return the new image
        Return bmp_New

    End Function
This is the function that produces your new image. I'd get your developer to have a play around with this function to see if any other methods produce better results (one that doesn't use the BitMap object may be better quality for a start).

As an example, you can use the GetThumbnailImage method for producing resized images and this method may produce a bteer quality image than simply making a new image of a certain size. Here's an example that they may want to follow:





-------------------------------------------------------

Mark,
[URL unfurl="true"]http://aspnetlibrary.com[/url]
[URL unfurl="true"]http://mdssolutions.co.uk[/url] - Delivering professional ASP.NET solutions
[URL unfurl="true"]http://weblogs.asp.net/marksmith[/url]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top