c# jpeg in tiff

  • Thread starter Thread starter Albert Greinöcker
  • Start date Start date
A

Albert Greinöcker

hi ng,

I have a question concerning image processing in .NET: How can I open a jpeg
with a tiff-header in c# (which means the file has the extension .tif, but
contains jpeg-compressed data)? When I try to open the image the usual way,
e.g.: Image img = Image.FromFile("thefilename.tif"), I get an error ("not
enough memory"). This meaningful error message always comes up when .NET
cannot deal with the Image format I think...

Thanks,
Albert
 
So it is a TIFF or a JPEG?

The internal file structure of them two is totally different.
 
Well, that's the tricky thing about it...it is a tif-file (with tif-header
and all that stuff, but it contains jpeg compressed image data, e.g.
Irfanview calls this Compression "Old JPEG (in TIFF)"). We get images of
that kind from our Kodak i260 scanner :-)
 
Just a guess, but you'll probably have to load the relevant JPEG data
into a Stream and then use the Image.FromStream method to load it into
an Image object.
 
Thanks a lot, yes that could work I think...but isn't it a strange thing
that one has to go so deep into the image to read it's content? Again: our
Kodak-Scanner writes this format by default!
 
Yes, images are strange. I've messed around with a few different
formats including icons and none of it is straight forward to me.
 
Back
Top