473,241 Members | 1,584 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,241 software developers and data experts.

Opening Tiff File Throws Out Of Memory Exception

Hey,

When I try to run the following code:

System.Drawing.Image tiffImage = System.Drawing.Image.FromFile(@"C:
\Image.tiff");

I get an "Out Of Memory" Exception.

Does anybody know how can I overcome this problem?

Thanks ahead

--sternr

May 31 '07 #1
6 6613
sternr,

Can you post the tiff? How large is it on disk?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"sternr" <St****@gmail.comwrote in message
news:11**********************@u30g2000hsc.googlegr oups.com...
Hey,

When I try to run the following code:

System.Drawing.Image tiffImage = System.Drawing.Image.FromFile(@"C:
\Image.tiff");

I get an "Out Of Memory" Exception.

Does anybody know how can I overcome this problem?

Thanks ahead

--sternr
May 31 '07 #2
On 31 Mai, 14:34, sternr <Ste...@gmail.comwrote:
Hey,

When I try to run the following code:

System.Drawing.Image tiffImage = System.Drawing.Image.FromFile(@"C:
\Image.tiff");

I get an "Out Of Memory" Exception.

Does anybody know how can I overcome this problem?

Thanks ahead

--sternr
Image.FromFile also throws an OutOfMemory exception when the image is
corrupted in some form or other errors occur, so you might want to
make sure that the file is a valid tiff, accessible and so on.

Sincerely,
Kevin Wienhold

May 31 '07 #3
KWienhold wrote:
On 31 Mai, 14:34, sternr <Ste...@gmail.comwrote:
>Hey,

When I try to run the following code:

System.Drawing.Image tiffImage = System.Drawing.Image.FromFile(@"C:
\Image.tiff");

I get an "Out Of Memory" Exception.

Does anybody know how can I overcome this problem?

Thanks ahead

--sternr

Image.FromFile also throws an OutOfMemory exception when the image is
corrupted in some form or other errors occur, so you might want to
make sure that the file is a valid tiff, accessible and so on.

Sincerely,
Kevin Wienhold
Also the format of the TIFF file might simply be unsupported. There are
some pretty unusual formats, you can for example create a TIFF image
that uses JPEG compression...

--
Göran Andersson
_____
http://www.guffa.com
May 31 '07 #4
On May 31, 8:01 am, KWienhold <hedov...@trashmail.netwrote:
Image.FromFile also throws an OutOfMemory exception when the image is
corrupted in some form or other errors occur, so you might want to
make sure that the file is a valid tiff, accessible and so on.
I've seen this as well: a corrupted tiff causes an
OutOfMemoryException. The only solution I've found is to catch the
exception for that call and treat it as though the image were
corrupted.

May 31 '07 #5
Thanks for all your responses!
I'm afraid I cannot post the tiff since it has value to my company...
The tiff's size is 90kb and I don't think the image is corrupted as I
can open it using Microsoft Imaging Preview.

I thought maybe the tiff is compressed using a compression
algorithm .Net does not support, but I could not find any
documentation for getting such info.

Any ideas?

Thanks ahead

--sternr

On May 31, 4:17 pm, "Nicholas Paldino [.NET/C# MVP]"
<m...@spam.guard.caspershouse.comwrote:
sternr,

Can you post the tiff? How large is it on disk?

--
- Nicholas Paldino [.NET/C# MVP]
- m...@spam.guard.caspershouse.com

"sternr" <Ste...@gmail.comwrote in message

news:11**********************@u30g2000hsc.googlegr oups.com...
Hey,
When I try to run the following code:
System.Drawing.Image tiffImage = System.Drawing.Image.FromFile(@"C:
\Image.tiff");
I get an "Out Of Memory" Exception.
Does anybody know how can I overcome this problem?
Thanks ahead
--sternr- Hide quoted text -

- Show quoted text -

Jun 3 '07 #6
I had a similar problem when working for a scanner company and using .net
1.1

In fact, I had JPEG within TIFF. As of .NET 1.1, this was not a supported
format and I got an out of memory exception.
I just did not find anyway to read it using the standard .net component. I
had to use a specialized one (e.g.: Pegasus).

- José

"sternr" <St****@gmail.coma écrit dans le message de news:
11**********************@o5g2000hsb.googlegroups.c om...
Thanks for all your responses!
I'm afraid I cannot post the tiff since it has value to my company...
The tiff's size is 90kb and I don't think the image is corrupted as I
can open it using Microsoft Imaging Preview.

I thought maybe the tiff is compressed using a compression
algorithm .Net does not support, but I could not find any
documentation for getting such info.

Any ideas?

Thanks ahead

--sternr

On May 31, 4:17 pm, "Nicholas Paldino [.NET/C# MVP]"
<m...@spam.guard.caspershouse.comwrote:
>sternr,

Can you post the tiff? How large is it on disk?

--
- Nicholas Paldino [.NET/C# MVP]
- m...@spam.guard.caspershouse.com

"sternr" <Ste...@gmail.comwrote in message

news:11**********************@u30g2000hsc.googleg roups.com...
Hey,
When I try to run the following code:
System.Drawing.Image tiffImage = System.Drawing.Image.FromFile(@"C:
\Image.tiff");
I get an "Out Of Memory" Exception.
Does anybody know how can I overcome this problem?
Thanks ahead
--sternr- Hide quoted text -

- Show quoted text -


Jun 3 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Scott Brady Drummonds | last post by:
Hello, all, My most recent assignment has me working on a medium- to large-sized Windows-based C++ software project. My background is entirely on UNIX systems, where it appears that most of my...
1
by: ramsin.savra | last post by:
Hi, I'm using same code for opening a TIFF file in VC++ works just fine but under linux it says unable to open the tiff file! Any comment on this? if (argc < 2) { cout << "Not enough...
0
by: whornak | last post by:
I am attempting to open a TIFF using Image.FromFile and keep getting the 'System.OutOfMemoryException' error. Help suggests that: "If the file does not have a valid image format or if GDI+ does...
6
by: Phil | last post by:
Hi I have an issue when trying to stream blob image data from a SQL table to a .aspx page. the code I have works for GIF and JPEG but the images can be multiple pages and we would like them to open...
3
by: T. Davis | last post by:
In C#, I am able to successfully stream a TIFF image that comes from a BLOB field in a database, save it to file, then convert the pages within TIFF file into jpegs (using GDI+) and display on the...
5
by: Shane Story | last post by:
I can seem to get the dimensions of a frame in a multiframe tiff. After selecting activeframe, the Width/Height is still really much larger than the page's actual dimensions. When I split a...
7
by: Ben | last post by:
Hi We are looking for a component that offers that offers the below for Tiff files: Image clean-up (deskew, despeckle) Printing capabilities from VB The ability to add text to image, e.g....
10
by: =?Utf-8?B?UmludSBHb3BhbGFrcmlzaG5hIFBpbGxhaQ==?= | last post by:
Hi, Please help me to write a dll in C# , that will read each pages of a tiff image from a file and a memory stream object ( need two ways) and creatre a new tiff image object.The dll should...
3
by: =?Utf-8?B?UGhpbCBKb2huc29u?= | last post by:
Hi, I am using dotnet remoting with a binarry formatter. I have a property that returns a memorystream that has had a file loaded into it. When I try to access this property though I get an...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.