Tom Phan - 2004-11-17

Hi,

When I rescale a GIF file, I got a black image return. The same code is working for JPEG file. I'd appreciated for any pointers.

Sample:
http://dev.telemedia.la/imageSvc/selftest.aspx

The code is in C# and very basic.

Code:
public byte[] GetBytes(string imageFilePath, int width, int height)
{
UInt32 dib = FreeImage.Load( Format, imageFilePath, 0 );

  try
  {
    if ( width != 0 && height != 0 )
    {
      UInt32 dib2 = FreeImage.Rescale( dib, width, height, FI_FILTER.FILTER_BILINEAR );
      FreeImage.Unload( dib );
      dib = dib2;
    }

    byte[] bytes = this.GetBytes( dib, Format );
    return bytes;
  }
  finally
  {
    FreeImage.Unload(dib);
  }

}

Thx,
Tom