High memory usage when converting mng image

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
AndreasEriksson
Posts: 3
Joined: 2015-05-20T01:21:57-07:00
Authentication code: 6789

High memory usage when converting mng image

Post by AndreasEriksson »

Hi, I am trying to convert https://dl.dropboxusercontent.com/u/250 ... 167b7d.png into a jpeg image but the convert process takes up all my ram and runs forever.

convert.exe" "ba969d5a-072f-4d8d-b5f7-5732c1167b7d.png" -layers flatten -depth 8 -colorspace sRGB -quality 50 -resize 256x256 -write "image.jpg" -quality 50 -resize 150x150 "image2.jpg

I am using ImageMagick-6.9.1-2-Q16-x64-static.exe

The image opens up ok in irfanview.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: High memory usage when converting mng image

Post by snibgo »

Clicking on your link, I get "The image https://dl.dropboxusercontent.com/u/250 ... 167b7d.png cannot be displayed because it contains errors."
snibgo's IM pages: im.snibgo.com
AndreasEriksson
Posts: 3
Joined: 2015-05-20T01:21:57-07:00
Authentication code: 6789

Re: High memory usage when converting mng image

Post by AndreasEriksson »

Download and open in irfanview.
User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Re: High memory usage when converting mng image

Post by glennrp »

It contains a LOOP chunk that says
  • chunk LOOP at offset 0x00106, length 5: nest level = 0
    count = 2147483647, termination = deterministic
So yes you'll run out of memory if you don't have enough to hold 2^31-1 frames.
AndreasEriksson
Posts: 3
Joined: 2015-05-20T01:21:57-07:00
Authentication code: 6789

Re: High memory usage when converting mng image

Post by AndreasEriksson »

Can I make it terminate somehow?

I have 16 GB of memory on my machine and it did not complete in 30 min and did not run out of memory.
The process went up to about 12 GB in the first minute and then it went back down again to about 1 GB.
It seems to be caching to disk as I almost ran out of space on my harddrive.
Post Reply