Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo


#84 Crash when resizing a jpeg

Algorithms (87)
Anders Ekdahl

When I try to resize a jpeg with -resize, the temp-file in /tmp/ increases in size until there is no more space left on the drive.

It only happens with some jpegs, and if I open it in Photoshop and save it, the problem goes away. Is there perhaps a way to "repair" the jpeg first?

The image I've been using can be found here:

And the command I've been trying to run is:
gm convert -resize 391x567 -size 391x567 "/var/www/pages/anders/m.jpg" "/var/www/pages/anders/m.jpg"

Doesn't matter what options I give, I've tried using both -size and -resize, using -geometry instead, but nothing seems to work.

My system is Debian Etch with Graphicsmagick 1.1.7-13.

I apologize if I haven't given enough info, just tell me what you need to know and I'll post it.


    • labels: --> Algorithms
    • assigned_to: nobody --> bfriesen
  • Logged In: YES
    Originator: NO

    I am unable to see any wrong behavior using the current GraphicsMagick release (1.1.11) or development GraphicsMagick 1.2. GraphicsMagick 1.1.7 is quite old and there have been many bug fixes since then. You should update if you can.

    How much RAM does your machine have? What does the output of 'gm convert -list resource' say?
    Since saving the file using Photoshop makes the problem go away it may be that there is some problem with one of the embedded profiles.

    By the way, the ideal command line order for your command is

    gm convert -size 391x567 "/var/www/pages/anders/m.jpg" -resize 391x567 "/var/www/pages/anders/m.jpg"

    since you want the -size option to apply to when m.jpg is read, and then want to enforce that size using -resize after m.jpg has been read.

  • Logged In: YES
    Originator: NO

    There was no response from the user. The user is using an outdated version. I am not able to reproduce the problem with current GraphicsMagick releases.

    • status: open --> closed-works-for-me