Page 1 of 1

[solved] Big jpeg issue

Posted: 2009-01-10T10:27:16-07:00
by broucaries
One user at debian seems to have encounter a bug on a huge 10000x15000 jpeg file. It look like a 32 bit/64 bit issue. could not reproduice myself my kernel get oom [2]

from debian bug 467393 [1]

>2008-02-25T00:04:18-05:00 0:01 0.050u 6.3.7 Cache a.out[10115]: cache.c/unknown/3438/Cache
> extend test.jpg[0] (/tmp/magick-XXPMBtqf[4], disk, 2.74383gb)
>2008-02-25T00:04:18-05:00 0:01 0.050u 6.3.7 Exception a.out[10115]: cache.c/unknown/3568/Exception
> unable to extend cache `test.jpg': Invalid argument
>
>when opening a large (over 15000x25000) JPEG. This only happens with 10.0.9,
>not 9.0.0.
>
>strace shows:
>pwrite64(13, "\0", 1, 18446744072360754175) = -1 EINVAL (Invalid argument)
>
>or 0xFFFFFFFFAF9AFBFF, as if some size is being calculated in signed 32-bit
>and then sign-extended to 64-bit.

Do not know if the problem is on the delegate library

Regards

Bastien

PS: original reporter does not answer to our mail, but it seem a likelly bug, nobody is crazy to create 2^15 jpeg image :)

[1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=467393
[2] convert -size 15000x15000 xc: -seed 171713 +noise Random test.jpeg

Re: Big jpeg issue

Posted: 2009-01-10T14:02:50-07:00
by magick
We create 10000x15000 and bigger images all the time. ImageMagick exited properly by throwing an exception. The exception, "unable to extend cache `test.jpg': Invalid argument" means that the temporary disk space required by the pixel cache could not be allocated. The solution is to point the temporary space that ImageMagick writes to a partition with plenty of free space. For example,
  • convert -define registry:temporary-path=/data/tmp mybigassimage.png mybigassimage.jpg
or you can set the MAGICK_TMPDIR environment variable.

Re: Big jpeg issue

Posted: 2009-01-10T16:45:39-07:00
by broucaries
Thank you

Regards

Basten