HighTechTalks DotNet Forums  

Tif problem?

Dotnet Framework (Drawing) microsoft.public.dotnet.framework.drawing


Discuss Tif problem? in the Dotnet Framework (Drawing) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Chris Ashley
 
Posts: n/a

Default Tif problem? - 08-31-2006 , 04:08 AM






I need to do some manipulation of Tif images, however I'm encountering
problems with multi-page Tif files.

If there are three or less pages in the Tif, everything seems to work
fine. However once the Tif goes above this I get a
'System.OutOfMemoryException: Out of memory.' - this is strange because
I can load a 10mb three-page Tif fine, but a 1mb four-page Tif won't
load so it can't be memory.

Is there a problem with the .NET support for Tif images?


Reply With Quote
  #2  
Old   
Bob Powell [MVP]
 
Posts: n/a

Default Re: Tif problem? - 08-31-2006 , 02:58 PM






There are no particular probblems that I know of.

Perhaps the article on multi-frame TIFF images in the GDI+ FAQ will help you
out.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.



"Chris Ashley" <chris.ashley2 (AT) gmail (DOT) com> wrote

Quote:
I need to do some manipulation of Tif images, however I'm encountering
problems with multi-page Tif files.

If there are three or less pages in the Tif, everything seems to work
fine. However once the Tif goes above this I get a
'System.OutOfMemoryException: Out of memory.' - this is strange because
I can load a 10mb three-page Tif fine, but a 1mb four-page Tif won't
load so it can't be memory.

Is there a problem with the .NET support for Tif images?




Reply With Quote
  #3  
Old   
aggc
 
Posts: n/a

Default RE: Tif problem? - 11-02-2006 , 05:11 AM



I had some problems with multi-page tiff files..
..net uses GDI+ to manipulate Images and recently i discover (with help of
others) that GDI+ doesn't support TIFF files with jpeg compression. Maybe 4th
page it's an TIFF file with jpeg compression..
When you invoke System.Drawing... FromFile and GDI+ doesn't support your
format then raises an expection 'System.OutOfMemoryException: Out of memory'

When you use System.Drawing... fromstream raise another exception 'Misses ...'




"Chris Ashley" wrote:

Quote:
I need to do some manipulation of Tif images, however I'm encountering
problems with multi-page Tif files.

If there are three or less pages in the Tif, everything seems to work
fine. However once the Tif goes above this I get a
'System.OutOfMemoryException: Out of memory.' - this is strange because
I can load a 10mb three-page Tif fine, but a 1mb four-page Tif won't
load so it can't be memory.

Is there a problem with the .NET support for Tif images?



Reply With Quote
  #4  
Old   
aggc
 
Posts: n/a

Default RE: Tif problem? - 11-02-2006 , 05:14 AM



More explicit...

Dim objImage As System.Drawing.Image

' FileStream
Dim fs1 As New FileStream("c:\newtest.tif", FileMode.Open, FileAccess.Read)
System.Drawing.Image.FromStream(fs1, True, False)

'Exception -> misses ojpeg tags compression

'MemoryStream
Dim fs1 As New FileStream("c:\test.jpg", FileMode.Open)
Dim r1 As New IO.BinaryReader(fs1)
Dim buffer(fs1.Length) As Byte
r1.Read(buffer, 0, fs1.Length)
r1.Close()
fs1.Close()
Dim ms As New MemoryStream(buffer)
ms.Flush()
objImage = System.Drawing.Image.FromStream(ms)

'Exception -> misses ojpeg tags compression

'FromFile
objImage = System.Drawing.Image.FromFile("c:\newtest.tif")

'Exception -> out of memory

System.Drawing.Bitmap doesn't work either.


"aggc" wrote:

Quote:
I had some problems with multi-page tiff files..
.net uses GDI+ to manipulate Images and recently i discover (with help of
others) that GDI+ doesn't support TIFF files with jpeg compression. Maybe 4th
page it's an TIFF file with jpeg compression..
When you invoke System.Drawing... FromFile and GDI+ doesn't support your
format then raises an expection 'System.OutOfMemoryException: Out of memory'

When you use System.Drawing... fromstream raise another exception 'Misses ...'




"Chris Ashley" wrote:

I need to do some manipulation of Tif images, however I'm encountering
problems with multi-page Tif files.

If there are three or less pages in the Tif, everything seems to work
fine. However once the Tif goes above this I get a
'System.OutOfMemoryException: Out of memory.' - this is strange because
I can load a 10mb three-page Tif fine, but a 1mb four-page Tif won't
load so it can't be memory.

Is there a problem with the .NET support for Tif images?



Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.