[solved] Big jpeg issue

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
broucaries
Posts: 467
Joined: 2008-12-21T11:51:10-07:00

[solved] Big jpeg issue

Post 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
Last edited by broucaries on 2009-01-10T16:46:10-07:00, edited 1 time in total.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Big jpeg issue

Post 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.
broucaries
Posts: 467
Joined: 2008-12-21T11:51:10-07:00

Re: Big jpeg issue

Post by broucaries »

Thank you

Regards

Basten
Post Reply