can you show us the code you sue for the manipulation of the images?
Main Topics
Browse All TopicsI am writing an application in Delphi 6 and using TFindfile component in thread mode for searching image files in folder. When next image founded, my procedure makes some image manupulations with creating TJpegImage and TBitmap instances.
After about 700 images being processed i recieve an error message Out of system resources. Please help me!
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
As a mentioned above, i am using TFindFile component. There is an onFileMatch event when image file found, here is the code inside:
inc(os_id);
buf := 0;
Memory := TMemoryStream.Create;
try
Memory.LoadFromFile(folder
memory.Read(buf, 2);
sign := inttohex(Buf, 2);
finally
Memory.Free;
end;
tiff2jpeg(folder+'image.TI
and here is Tiff2Jpeg function:
var
tiff,bmp: PFIBITMAP;
b: TBitmap;
FileFormat: FREE_IMAGE_FORMAT;
jpg: TJpegimage;
begin
b:=TBitmap.Create;
jpg:=TJPEGImage.Create;
FileFormat:=FreeImage.Free
case FileFormat of
FIF_TIFF: begin
try
tiff:=FreeImage.FreeImage_
FreeImage.FreeImage_Save(F
try
try
b.LoadFromFile('c:\test.bm
b.Canvas.Font.Size:=7;
b.Canvas.Font.Name:='Tahom
b.Canvas.TextOut(0,0,Water
jpg.Assign(b);
finally
b.free;
end;
jpg.CompressionQuality:=Qu
jpg.Compress;
jpg.SaveToFile(dFilename);
finally
jpg.Free;
end;
finally
freeimage.FreeImage_unload
end;
end;
end;
FileFormat:=FreeImage.Free
b:=TBitmap.Create;
jpg:=TJPEGImage.Create;
try
case FileFormat of
FIF_TIFF: begin
tiff:=FreeImage.FreeImage_
FreeImage.FreeImage_Save(F
b.LoadFromFile('c:\test.bm
b.Canvas.Font.Size:=7;
b.Canvas.Font.Name:='Tahom
b.Canvas.TextOut(0,0,Water
jpg.Assign(b);
jpg.CompressionQuality:=Qu
jpg.Compress;
jpg.SaveToFile(dFilename);
end;
end;
finally
b.Free;
jpg.Free;
freeimage.FreeImage_unload
end;
No, Ziolko, this still doesn't work, the same error!
look at this, are you running the latest version?
http://www.delphiarea.com/
..i've looked at the demo program that comes with findfile; what i did notice was that the onfilematch proc is ended with
if not FindFile.Threaded then
Application.ProcessMessage
might be nothing.
the multithreading will probably increase resources needed ; maybe you can look at that.
I dont know, maybe it just uses that much resources and you should consider a workaround.
It's a bit late, but accidentally I saw this post and I saw although you have solved the problem but nobody had an idea what's going on.
When TFineFile is working on threaded mode, the OnFileMatch event does not occur in the main VCL thread. In other hand, whenever a bitmap's canvas is going to be modified in another thread, you must do it inside Canvas.Lock / Canvas.Unlock block, otherwise memory leak or bitmap corruption may occur.
In your case, you must lock the canvas when adding watermark to it.
b.Canvas.Lock;
try
b.Canvas.Font.Size:=7;
b.Canvas.Font.Name:='Tahom
b.Canvas.TextOut(0,0,Water
fina
b.Canvas.Unlock;
end;
Business Accounts
Answer for Membership
by: ziolkoPosted on 2007-08-16 at 02:01:41ID: 19706368
probably you (or components you use) not releaisng resources
net
see here: http://fastmm.sourceforge.
this will help you to track down memmory leaks
ziolko.