Last post Dec 01, 2008 11:19 PM by sreejukg
Nov 30, 2008 07:30 AM|madhumad|LINK
I am trying to crop a tiff image in c#. But Image.FromFile(...) method is throwing error "Out of Memory".
I analysed the situation and found that some images of tiff format are working fine and some are throwing error. I also analyzed that
images that are not working have one thing in common... i.e. when i checked the properties of these images i see that "Summary" tab is
having no data...
And there was data in summary tab for those images who were working fine...
Nov 30, 2008 08:15 AM|sreejukg|LINK
if you are getting out of memory error for imagefromfile method, check it is a valid image and aspnet machine account have access to it. Check the ACLs on the image
Nov 30, 2008 11:36 PM|madhumad|LINK
Images which are showing "Out of Memory" error are also not opening in imaging preview.But these images are opening in other applications such as Windows Presentation Foundation applications. As i previously said that i think its happening just because
these images are having no summary details(in summary tab) in their properties.
Dec 01, 2008 10:10 AM|SGWellens|LINK
It's possible the images were not written correctly. Some applications can handle this better than others. You may need to get a third party library to open, correct and save the images so .Net can read them.
TIFF tags can be binary or text.
Maybe .Net is looking for a null terminator in the summary tag and there is none.
Maybe when there is no text, the saving program is putting -1 as the field length and .Net goes off looking for it.
Dec 01, 2008 11:19 PM|sreejukg|LINK
the possible chances are
1. the aspnet account dont have permission. - in this case you will get out of memory error. Check the permissions on the image file. Since using your windows account also you are unable to preview the image, there are chances that both aspnet acct and your
windows account both dont have permission over the image. Try to copy the image and paste in somewhere else, if you succeed on this that means you have sufficient permission on this.
2. the image file is not in right format. This might be another option, since other applications opens this chances for this is less...