Error creating thumbnail: convert: Insufficient memory (case 4) (High resolution JPG)
Closed, ResolvedPublic


Author: esby

Reported the issue on Commons Village Pump

It might be a bug or a feature:

The issue appears on some recent and large jpg files uploaded:

There is basically no thumb showing up.

When trying to generate the thumb again:

Error creating thumbnail: convert: Insufficient memory (case 4) `/mnt/upload6/wikipedia/commons/6/6d/Night_Panorama_of_the_Potsdamer_Platz_-_Berlin_-_2012-06-03_-_P1400487-P1400537.jpg' @ error/jpeg.c/EmitMessage/235.
convert: missing an image filename `/tmp/transform_4597d64-1.jpg' @ error/convert.c/ConvertImageCommand/2970.

Note: this file, similar in size and resolution (but a bit lower) got a thumb generated:

I can see two possibles causes:

  • a max width issue ? ( 16069 < 16384 (limit?) < 20k )
  • a max memory issue: 37,91 MB < limit somewhere ? < 38,39 MB )

This also seems related to imagemagick,
the setting being near 38 MB if she second possibility applies.

Old images bigger than the one causing problems have thumbs on commons:

Version: unspecified
Severity: normal
See Also:


bzimport set Reference to bz37367.
bzimport added a subscriber: Unknown Object (MLST).
bzimport created this task.Jun 6 2012, 9:47 AM

esby wrote:

The jpeg was encoded with progessive.
A work around if to reencode with non progressive setting.

Copying discussion from village pump since the village pump bot will archive it.

uploaded a new version of the file with commonist, had the same bug. I also managed to upload a 38 mb file using commonist while keeping the thumb. Esby (d) 09:01, 6 June 2012 (UTC)
to be precise, this file (16 069 × 4 141 - 37,91 MB) has a thumb while this one (20 000 × 3 963 38,39 MB) does not have any. Esby (d) 09:13, 6 June 2012 (UTC)
Forgot to mention I had opened a bug on bugzilla [2] Esby (d) 14:05, 6 June 2012 (UTC)

    Usually this occurs with progressive encoded JPEGs. Standard/baseline encoded JPEGs can be rescaled scanline by scanline, but progressives cannot, and the standard converter requires enough memory to hold the entire image. Try resaving it with baseline encoding and similar or slightly higher quality. Dcoetzee (d) 12:27, 6 June 2012 (UTC)

        Hm, COM:MAXTHUMB has the limit lower than that, at 12.5 Megapixels or around 3500 x 3500 px. If possible, this should be updated. Rd232 (d) 17:58, 10 June 2012 (UTC)

            Unrelated, we are talking of jpeg, not of png / tiff files etc. I fixed the issue by reuploading the file saved as non progressive. Esby (d) 13:58, 11 June 2012 (UTC)

See also bug #37563

This is a duplicate of bug #24228 ?!

(In reply to comment #3)

This is a duplicate of bug #24228 ?!

If so please mark this as "resolved duplicate" because I can't do so.

TheDJ added a comment.Aug 23 2012, 5:05 PM
  • This bug has been marked as a duplicate of bug 24228 ***
  • This bug has been marked as a duplicate of bug 17645 ***

Add Comment