473,385 Members | 1,347 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,385 software developers and data experts.

Out of memory when loading an image file

When I tried to load 2GB tiff file, I got an "out of memory" error.
I have 512MB memory, but I set virtual memory to 5GB.
Is it possible to cut the big tiff file into several sub-images
without loading the whole image?

Sep 23 '07 #1
4 3351
I seem to recall that you get a misleading "out of memory" exception when
the format of the image file is wrong, so make sure you can load a smaller
image of the exact same type, and if not, look for other causes of the
problem.

"FrankMeng" <me********@gmail.comwrote in message
news:11**********************@y42g2000hsy.googlegr oups.com...
When I tried to load 2GB tiff file, I got an "out of memory" error.
I have 512MB memory, but I set virtual memory to 5GB.
Is it possible to cut the big tiff file into several sub-images
without loading the whole image?

Sep 23 '07 #2
FrankMeng wrote:
When I tried to load 2GB tiff file, I got an "out of memory" error.
I have 512MB memory, but I set virtual memory to 5GB.
While Michael made a good point about the misleading errors, if your
TIFF is actually 2GB it's not necessarily surprising that you would get
an "out of memory" error trying to load it.

For sure, there's no way you'd be able to load that under 32-bit
Windows. If I recall correctly, even under 64-bit Windows, .NET is
still 32-bit though, and can't deal with objects larger than 2GB.

If your question hasn't been answered either by Michael's post or the
above, you should probably be more specific about the exact environment
you're using to attempt this.
Is it possible to cut the big tiff file into several sub-images
without loading the whole image?
Yes, but AFAIK there's nothing in .NET that would do this for you.
You'll have to parse the TIFF yourself and extract the specific data you
want for each sub-image.

Pete
Sep 23 '07 #3
"Peter Duniho" <Np*********@NnOwSlPiAnMk.comwrote in message
news:13*************@corp.supernews.com...
FrankMeng wrote:
>When I tried to load 2GB tiff file, I got an "out of memory" error.
I have 512MB memory, but I set virtual memory to 5GB.

While Michael made a good point about the misleading errors, if your TIFF
is actually 2GB it's not necessarily surprising that you would get an "out
of memory" error trying to load it.
Also, 2 GB is an enormous TIFF. Assuming it's 64 bits per pixel (16-bit
CMYK), that's still 16 megapixels. What is the source of the image?
Sep 23 '07 #4
Peter Duniho wrote:
For sure, there's no way you'd be able to load that under 32-bit
Windows. If I recall correctly, even under 64-bit Windows, .NET is
still 32-bit though, and can't deal with objects larger than 2GB.
I think .NET is 64 bit as in that a reference is 64 bit and can
address in 64 bit space. There are just still a limit on maximum
object size.

Arne
Sep 23 '07 #5

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

Similar topics

5
by: Ian | last post by:
I have and Access 97 DB that prints a report that has many pages, sometime about 800-1000 page, each page contains a colour picture along with text boxes. The pictures are displayed on the...
11
by: Shane Suebsahakarn | last post by:
Hi all, This might be one of those things for which there is no workaround. I'm using A2K2, and using it to perform a very large batch ouput. Both the front and back ends are MDB files, so no...
5
by: Sharon | last post by:
I’m writing a Windows application. In the form I have a Panel and inside the panel I have a PictureBox control. I’m loading the PictureBox control with BMP image that has the following...
3
by: Jeff | last post by:
I've been working on an application for a while now that has been giving me some trouble when it comes to working with a picturebox and memory usage. My company deals with digital imaging, so we...
6
by: comp.lang.php | last post by:
I have an image that's only 100K in size, and I am working with 8mb of memory. If I do this: print_r(ceil((int)ini_get('memory_limit') * 10 *...
6
by: Bob Bedford | last post by:
Hi all, I've to resize uploaded images with the "imagecopyresampled" but when I've images quite large (common those days) I reach the 16mb limits of the ISP. How can I fix this ? I absolutely...
1
by: FrankMeng | last post by:
When I tried to load 2GB tiff file, I got an "out of memory" error. I have 512MB memory, but I set virtual memory to 5GB. Is it possible to cut the big tiff file into several sub-images without...
0
by: =?Utf-8?B?UGhpbCBKb2huc29u?= | last post by:
Hi, I am working on an ASP.NET 1.1 application that creates thumbnails using the code below. Problem is that the code loads an entire file into memory to instantiate the image (file.Data is a...
6
by: dantz | last post by:
HI everyone, I hope someone can help me on this. I have form application that has 3 Timers that does an animation (changing an image for every interval) Each image are loaded at start of...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.