notebook
notebook copied to clipboard
Uploading an animated .gif as an image causes a 500 error
Expected behavior
Uploading an animated .gif should in the image uploader either: A: Upload the animated gif successfully, like any other image format B: Present a proper error stating this image type cannot be uploaded
Actual behavior
Attempting to upload an animated .gif causes the webpage to hang for several seconds, then displays a 500 internal server error message
Steps to reproduce the behavior
1: Edit a notebook page
2: Navigate to the Gallery tab (URL /edit#gallery_panel)
3: Attempt to upload an animated .gif
For reference, this is the image file that was attempted:

Hey, thanks for reporting this.
Checking out the server logs, it looks like imagemagick is failing while creating thumbnails/resizes for the image. I'll have to take a look into what exactly is going on and get it fixed up.
The failing command, for reference:
convert '/tmp/79138d3a914c428fcb1c825ec741cad020170818-18-sc52db.gif' -coalesce -auto-orient -resize "190x" -crop "190x190+0+0" +repage -layers "optimize" '/tmp/79138d3a914c428fcb1c825ec741cad020170818-18-sc52db20170818-18-mlbjab'
And a similar command run immediately before that passes:
convert '/tmp/79138d3a914c428fcb1c825ec741cad020170818-18-sc52db.gif' -coalesce -auto-orient -resize "100x100>" -layers "optimize" '/tmp/79138d3a914c428fcb1c825ec741cad020170818-18-sc52db20170818-18-4twyep'
Could also be that the server processing the request is running out of memory on that command, so I just added another server to help distribute load. We'll see if that helps at all.
Image uploading has changed enough since this issue was opened that we should double check that this is still erroring before starting work on this.