471,337 Members | 1,275 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,337 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 6433
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Scott Brady Drummonds | last post: by
1 post views Thread by ramsin.savra | last post: by
reply views Thread by whornak | last post: by
6 posts views Thread by Phil | last post: by
10 posts views Thread by =?Utf-8?B?UmludSBHb3BhbGFrcmlzaG5hIFBpbGxhaQ==?= | last post: by
3 posts views Thread by =?Utf-8?B?UGhpbCBKb2huc29u?= | last post: by
reply views Thread by rosydwin | last post: by

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.