Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

3rd party Software and Multipage TIFFs

Status
Not open for further replies.

Goofus828

Programmer
Nov 9, 2005
127
US
Hi all,
I have an application in VFP 9.0 that needs to seperate multipage tiffs in to the individual pages. I bought a third party software to do so ( image viewer cp pro ). But here is the problem. I have 27,000+ individual images that need to be seperated out. In the end I'll have 54,000+ images. Doing this in bulk, I crash after ~5000 images. I get the C0000005 error. The company says it is a memory issue. I've run this on 4 different machines, 2000 and XP, all with 1 gig of ram. So I don't think it is that.

I'm not asking to solve this problem but asking for recommendation on what else is out there that the community uses.

Thanks.
 
I'm with Tamar. Some sort of resource issue. Which I don't think you'll be able to get rid of simply by using another product unless you are able to manage memory with it.
Using CLEAR RESOURCES, or at least being able to release a current picture resource prior to consuming more memory resource is probably going to be the only option.


-Dave Summers-
[cheers]
Even more Fox stuff at:
 
Thanks to both of you. I will explore this and post my results.
 
Well I added CLEAR RESOURCE to my code but it did not help.

This is what I'm doing:

I have a CD with ~50 files. In each file are images of cancelled checks from the bank. These images are multiple page TIFFs and they are concatenated together. So inside each of the 50 files are hundreds of image files.

I know the start and end position of each check image so I use FSEEK() and FREAD() to save the image to a variable called cChkImage. I then take cChkImage and using STRTOFILE() save it to file called Junk.TIF. This is where the 3rd party OCX comes into play. I take the file, Junk.Tif and save the front of the check and save the back of the check.

Here is the code:

Code:
= FSEEK( nHandle, VAL( tmpData.cStart ), 0 )
cChkImage = FREAD( nHandle, VAL( tmpData.cLength ))

** get the multi image tif and save it a temp name
xJunk = STRTOFILE( cChkImage, "c:\temp\junk.tif" )


cChkFileF  = cSaveTo + cChkFileF
cChkFileB  = cSaveTo + cChkFileB
** save each side of the check to a file


xJunk1 = THISFORM.oleCDImport.exportTIF( "c:\temp\junk.tif", "c:\temp\Front", "TIF", 1 )
xJunk2 = THISFORM.oleCDImport.exportTIF( "c:\temp\junk.tif", "c:\temp\back",  "TIF", 2 )

COPY FILE C:\TEMP\FRONT.TIF TO ( cChkFileF )
COPY FILE C:\TEMP\BACK.TIF  TO ( cChkFileB )
CLEAR RESOURCES 

RELEASE xJunk, xJunk1, xJunk2, cChkImage

xJunk1 and xJunk2 are numerics (1 or 0 ) to indicate sucess or failure of the export.
cChckImage is the TIf file data stream.
xJunk is the size of the TIF image in bytes.

So I'm not real sure on the syntax of CLEAR RESOURCES in this situation and how it would apply.

Thanks for your time.
Josh.
 
~5000 images. I get the C0000005 error. The company says it is a memory issue.

You should not be getting the C00.... error. Try this:

Open the windows task manager, run you app, under Performance see what the CPU and the Memory usage is. If it jumps over half the physical memory of the machine running the app, it is a Memory overload. BUT you should not get the C00 error but a "Not enough memory to file map" error (which is misleading)
Anyway if it exceeds half - at the start of yor program limit the memory with a sys(3050,1,<< half the total memory>>)
The problem is VFP is a memory hog and grabs more memory that what it is capable of using. Rule of thumb is 512000000 for a 1GB.
If this is in a loop put in a sys(1104) after 1000 or sorecords are processed
Maybe VFP is grabbing so much memory the other apps running are giving you the C00... error
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top