Page 1 of 1

Convert large TIFF to JP2 fails

Posted: 2008-11-11T10:53:17-07:00
by stacemaples
I'm testing ImageMagick to automate the conversion of large TIFFS to JP2. I'v3e successfully converted Tiffs up to 93.3 MB in size, but testing a 162.1 MB Tiff conversion fails with the following:

C:\Documents and Settings\sdm53>convert d:\digitize\scan4.tif -limit memory 2048
-quality 100 d:\digitize\test4.jp2

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

C:\Documents and Settings\sdm53>


We typically will need to convert images of 300MB+ (up to 1GB in some cases)

My system configuration is: Windows XP Pro SP3 / P4 3.8GHz 3.25GB RAM

Anyone have any ideas on this? Solutions?

Re: Convert large TIFF to JP2 fails

Posted: 2008-11-11T21:43:01-07:00
by magick
If you have an older version of ImageMagick, upgrade and see if that makes a difference. Set the memory limit to 1mb so the conversion takes place on disk. Make sure you have terabytes of free disk space since your image is cached to disk. If your free space is on a particular hard drive, set the MAGICK_TEMPORARY_PATH environment variable to point to that partition. Keep in mind that JPEG has a limit of 65535 pixels in width or height. If you have a Linux box, try the conversion there. Finally, if all else fails, send us a PM with a URL to one of the images that fails and the command you are using. We'll download it and see if we can reproduce the problem.

Re: Convert large TIFF to JP2 fails

Posted: 2008-11-12T10:27:42-07:00
by stacemaples
Do you mean the MAGICK_TEMPORARY_PATH variable in the configure.xml file?

Re: Convert large TIFF to JP2 fails

Posted: 2008-11-12T10:29:50-07:00
by stacemaples
Also, why on earth would IM require terabytes of disk resources to convert a <GB image? We're running a proprietary converter (ECW) on a machine with little more than 50GB of free space without trouble.

Re: Convert large TIFF to JP2 fails

Posted: 2008-11-12T11:15:58-07:00
by magick
See http://www.imagemagick.org/script/architecture.php for an explanation of how the pixel cache works.

If ECW uses less resources and does the conversion to your satisfaction we recommend you use it instead of ImageMagick. No one program can solve all image-processing problems well.

Both MAGICK_TMPDIR and MAGICK_TEMPORARY_PATH can be used to specify the path to temporary storage space for ImageMagick.

Re: Convert large TIFF to JP2 fails

Posted: 2009-04-23T12:27:11-07:00
by sgmurphy19
Was there ever a solution discovered for this? I need to convert .Tif (all with less than 65K pixels in either direction) though at sizes > 100MB. Thusfar I am experiencing the same response:
"
F:\SMurphy\ForSean-TestSet>convert 600dpi-LZW_compression-1.tif jp2:converted\600dpi-LZW_compression-1.jp2

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
"

I have tried the suggestions above and my configure.xml is as follows:
"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE configuremap [
<!ELEMENT configuremap (configure)+>
<!ELEMENT configure (#PCDATA)>
<!ATTLIST configure name CDATA #REQUIRED>
<!ATTLIST configure value CDATA #REQUIRED>
]>
<configuremap>
<configure name="NAME" value="ImageMagick"/>
<configure name="LIB_VERSION" value="0x651"/>
<configure name="LIB_VERSION_NUMBER" value="6,5,1,5"/>
<configure name="RELEASE_DATE" value="2009-05-01"/>
<configure name="VERSION" value="6.5.1"/>
<configure name="CC" value="vs7"/>
<configure name="HOST" value="windows-unknown-linux-gnu"/>
<configure name="DELEGATES" value="bzlib freetype jpeg jp2 lcms png tiff x11 xml wmf zlib"/>
<configure name="COPYRIGHT" value="Copyright (C) 1999-2009 ImageMagick Studio LLC"/>
<configure name="WEBSITE" value="http://www.imagemagick.org"/>
<configure name="MAGICK_TEMPORARY_PATH" value="g:/tmp"/>
<configure name="MAGICK_MEMORY_LIMIT" value="1mb"/>
<!-- <configure name="MAGICK_MAP_LIMIT" value="8eb"/> -->
<!-- <configure name="MAGICK_AREA_LIMIT" value="4eb"/> -->
<!-- <configure name="MAGICK_DISK_LIMIT" value="16eb"/> -->
<!-- <configure name="MAGICK_FILE_LIMIT" value="768"/> -->
<!-- <configure name="MAGICK_THREAD_LIMIT" value="8"/> -->
</configuremap>
"

As you can see from this file, I am using the most current version of ImageMagick.

Thanks, any help is appreciated!
Sean

Re: Convert large TIFF to JP2 fails

Posted: 2009-04-23T13:02:40-07:00
by magick
Can you post a URL to your input image? We tried converting a number of TIFF images to JP2 with ImageMagick 6.5.1-6, the current release, and all the commands completed successfully.

Re: Convert large TIFF to JP2 fails

Posted: 2009-04-23T13:41:52-07:00
by sgmurphy19
Thanks for responding so quickly. You can download a .tiff I've received this error from at: http://brit1.brit.org/temp/sgmurphy19_tiff.zip

Also, I tried adding the option "convert -limit area 1mb 600dpi-no_compression-1.tif jp2:converted\600dpi-no_compression-1.tif.jp2" and it completed, though with a 0KB sized file.

Thanks again,
Sean

Re: Convert large TIFF to JP2 fails

Posted: 2009-04-24T06:19:50-07:00
by magick
The problem is within the Jasper delegate library, not ImageMagick. Jasper commits suicide if it cannot allocate a buffer within the jpc_qmfb_split_colgrp() method.

Re: Convert large TIFF to JP2 fails

Posted: 2009-04-24T13:57:51-07:00
by sgmurphy19
Do you a recommended approach or do we need to find a different avenue for our project in order to convert these large files?

Thanks again for all your effort!

Re: Convert large TIFF to JP2 fails

Posted: 2009-04-24T14:12:53-07:00
by magick
ImageMagick can handle giga-pixel images but some of the delegate libraries may not be able to. However we could convert your image without complaint on our 64-bit Linux box. It may work under 64-bit Windows as well. If either of those solutions won't work for you, you can try some other program but we do not have any recommendations.

Re: Convert large TIFF to JP2 fails

Posted: 2009-05-04T01:59:36-07:00
by sgmurphy19
btw,
Setting ImageMagick up on a 64 bit machine worked for me as well. Thanks for all your help.