Page 1 of 1
Ping large amount of images
Posted: 2008-10-30T03:55:05-07:00
by ivan.savu
Hi everybody,
I'm using Magick++ to obtain information about large number of very big images. I'm using ping method, from Magick::Image. My problem is that although I'm just pinging images, ImageMagick creates temporary files in temp folder, and after pinging large amount of files, I run out of space (Temp folder reaches 50GB). I tried limiting disk usage with MagickCore::SetMagickResourceLimit(MagickCore::DiskResource, 0); but then I get the "cache resource exhausted" exception. Is there any way I could disable caching ? Any help would be welcome.
Thanks, and please excuse my lousy English
.
Re: Ping large amount of images
Posted: 2008-10-30T05:54:24-07:00
by magick
With most formats, pinging is lightweight. However, a few require that they first be cached to disk. Which image formats are you pinging? Can you post a small as possible Magick++ source code that illustrates the problem?
Re: Ping large amount of images
Posted: 2008-10-30T06:42:11-07:00
by ivan.savu
Thanks for quick reply
.
I'm working with 1bit tiff files. Here's output of identify for one of them, they should all be of same size. There's around 700 of such images.
Code: Select all
a4b2.tif TIFF 9449x5906 9449x5906+0+0 1-bit Bilevel DirectClass 777kb 0.344u 0:01
identify.exe: incorrect count for field "DateTime" (11, expecting 20); tag ignored. `a4b2.tif'.
identify.exe: a4b2.tif: unknown field with tag 33550 (0x830e) encountered. `TIFFReadDirectory'.
identify.exe: a4b2.tif: unknown field with tag 33922 (0x8482) encountered. `TIFFReadDirectory'.
Here's a snippet of trimmed down code of what I'm doing:
Code: Select all
for ( recursive_directory_iterator iter(imagesPath); iter != endIter; iter++ )
{
Magick::Image image_loader = Magick::Image();
path image_file = iter->path();
try
{
image_loader.ping(imageFile.string());
}
catch(...)
{
//Exception Handling...
}
}
while the loop executes ImageMagick creates large number of magick-* files in Temp directory. Each file is 213M big. This continues until I run out of space..
I ping each file exactly once, so I don't need to keep cache for all of them, any way I can achieve this ? Thanks.
Re: Ping large amount of images
Posted: 2008-10-30T07:16:50-07:00
by magick
We can reproduce the problem you posted and will have a fix for it in the ImageMagick Subversion trunk within a day or two. The patch will be available in the next point release as well. Thanks.
Re: Ping large amount of images
Posted: 2008-10-30T07:48:35-07:00
by ivan.savu
Thanks
If there's anything I can do to help, just say it.