I am using the Image.FromFile method to load tiff files. After loading the
tiff files I convert them to jpeg's. However, if the tiff file has an
"indexed pixel format" the Image.FromFile method throws an exception.
I can't convert the tiff files before loading them because the files are
delivered from a network-scanner.
I've also tried this:
Bitmap bmp = new Bitmap("Myfile.tif")
, but this throws the exception: "invalid parameter used".
Have I overlooked something in this namespace???
Please help me - thanks
/Dan
Oscar Papel - 05 Jun 2004 00:07 GMT
You need to convert the source image to a non-indexed format before saving
to jpeg.
There are a variety of ways to do this.
You could create an RGBA image and draw on it using the src image.
btw,
It is odd for scanners to deliver indexed formats in the first place.
You might be better off fixing the scanner configuration since you are now
effectively double-compressing. As a side benefit, you might be able to
generate JPG files directly.
Oscar.
> I am using the Image.FromFile method to load tiff files. After loading the
> tiff files I convert them to jpeg's. However, if the tiff file has an
[quoted text clipped - 14 lines]
>
> /Dan
Dan Kjaergaard - 06 Jun 2004 16:02 GMT
Hi Oscar
Is it possible to convert the source images using the .NET framework?
Many network-scanners are configured to deliver this format (Xerox, Toshiba
etc.), so I can't rely on the configuration of these.
You mention creating an RGBA image and drawing on it using the src image.
How can I do that when I can't open the src image in the first place?
thanks
/Dan
> You need to convert the source image to a non-indexed format before saving
> to jpeg.
[quoted text clipped - 29 lines]
> >
> > /Dan
Bill Broker - 25 Jun 2004 21:26 GMT
Try LEADTOOLS, they have a .NET class library, and it handles lots of
variations/flavors of
Tiff images that the .NET Framework can't handle. (www.leadtools.com)
> I am using the Image.FromFile method to load tiff files. After loading the
> tiff files I convert them to jpeg's. However, if the tiff file has an
[quoted text clipped - 14 lines]
>
> /Dan