locked
Image manipulation behaving different in IIS RRS feed

  • Question

  • User-234661480 posted

    Hi,

    I just made a quick little program that resizes, watermarks, and converts images to grayscale on demand. The program is in the form of an HttpHandler.

    It works perfectly from the development environment, but when I uploaded it to my IIS 7 Windows 2008 Server, the image manipulation is no longer working correctly.

    It is not resizing the images properly - they are way smaller then they should be. It is also not applying the watermark correctly, as it used to resize the watermark so that it wasent too big for the picture, then put it in the middle. It no longer resizes the watermark.

    Does anyone know of any settings that could be causing this to behave differently on the server vs. the development environment?

    Thanks.

    Mobius5150

    Monday, June 21, 2010 9:58 PM

All replies

  • User191633014 posted

    Perhaps your problem is in different versions of .NET Framework...

    Instal to your server identical framework like your development environment and set IIS to use them for this site.

    Tuesday, June 22, 2010 3:16 AM
  • User-234661480 posted

    Hey,

    As far as I can tell, they are using the same framework. When I click help-->About in Visual Studio 2010 It tells me its using version 4.0.30319 and the IIS 7 application pool is also set to use asp.net 4.0.30319.

    Would the VS development server use a different framework then VS?

    Mobius

    Wednesday, June 23, 2010 2:10 AM
  • User-234661480 posted

    Okay, So i played with a bit of code, and found this:

    returnGraphics.DrawImage(logo, New Point(((width / 2) - (logo.Width / 2)), ((height / 2) - (logo.Height / 2)))) 'Original line
    returnGraphics.DrawImage(logo, New Rectangle(New Point(((width / 2) - (logo.Width / 2)), ((height / 2) - (logo.Height / 2))), New Size(logo.Width, logo.Height)))'New line

    The first line produces very different results than the second line. This was one change, among many.

    Basically, this line watermarks the logo onto an image. The first line draws the full sized logo (3577x787px) at full size, even though it was supposed to have been resized to an appropriate size by another function (not shown).

    Does anyone know why these would produce such different results?

    Wednesday, June 23, 2010 9:08 PM