-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issues with GIFs #37
Comments
Happens with every gif?
…On Wed, May 9, 2018, 7:43 PM tortilaman ***@***.***> wrote:
I've run into a very odd issue with gifs. It revolves around JIMP, but I
haven't seen it mentioned there, so I'm not 100% sure yet whether the issue
is with JIMP, or with this particular implementation of it.
When trying to upload a gif with apostrophe-images, it gives the generic
image error in the browser, and on the server, it gives the following error
output:
Unsupported MIME type: image/gif
Unsupported MIME type: image/gif
Unsupported MIME type: image/gif
Unsupported MIME type: image/gif
Unsupported MIME type: image/gif
Unsupported MIME type: image/gif
TypeError: Cannot read property 'bitmap' of undefined
at Jimp.<anonymous> (/Users/nick/Development/annual-report/cms/node_modules/apostrophe/node_modules/uploadfs/lib/image/jimp.js:46:34)
at Jimp.throwError (/Users/nick/Development/annual-report/cms/node_modules/jimp/index.js:85:44)
at ReadFileContext.callback (/Users/nick/Development/annual-report/cms/node_modules/jimp/index.js:201:44)
at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:366:13)
Jimp knows what the MIME type is in previous functions, and has a
conditional to handle image/gif specifically, yet when it gets here, the
image variable is undefined. Let me know if there's more information I
can provide, I'm not the best at debugging, haha.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#37>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAB9ffPXObg83RLGmmi6qA2ISCQvlS_uks5tw38ogaJpZM4T5J43>
.
|
Jimp is the slowest option btw but of course we want it to work too because
it is the zero effort option.
…On Wed, May 9, 2018, 7:43 PM tortilaman ***@***.***> wrote:
I've run into a very odd issue with gifs. It revolves around JIMP, but I
haven't seen it mentioned there, so I'm not 100% sure yet whether the issue
is with JIMP, or with this particular implementation of it.
When trying to upload a gif with apostrophe-images, it gives the generic
image error in the browser, and on the server, it gives the following error
output:
Unsupported MIME type: image/gif
Unsupported MIME type: image/gif
Unsupported MIME type: image/gif
Unsupported MIME type: image/gif
Unsupported MIME type: image/gif
Unsupported MIME type: image/gif
TypeError: Cannot read property 'bitmap' of undefined
at Jimp.<anonymous> (/Users/nick/Development/annual-report/cms/node_modules/apostrophe/node_modules/uploadfs/lib/image/jimp.js:46:34)
at Jimp.throwError (/Users/nick/Development/annual-report/cms/node_modules/jimp/index.js:85:44)
at ReadFileContext.callback (/Users/nick/Development/annual-report/cms/node_modules/jimp/index.js:201:44)
at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:366:13)
Jimp knows what the MIME type is in previous functions, and has a
conditional to handle image/gif specifically, yet when it gets here, the
image variable is undefined. Let me know if there's more information I
can provide, I'm not the best at debugging, haha.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#37>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAB9ffPXObg83RLGmmi6qA2ISCQvlS_uks5tw38ogaJpZM4T5J43>
.
|
I tried it with several different gifs. Different tools were used to export them and I had them exported at different sizes. I was a bit confused why it was trying to use Jimp and not ImageMagick or something else. |
You have to have the imagemagick convert and identify utilities in your
PATH.
…On Thu, May 10, 2018, 1:32 PM tortilaman ***@***.***> wrote:
I tried it with several different gifs. Different tools were used to
export them and I had them exported at different sizes.
I was a bit confused why it was trying to use Jimp and not ImageMagick or
something else.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#37 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAB9fTNV55ojkVG_pNu7OVrTqIjWDnauks5txHmrgaJpZM4T5J43>
.
|
Ah, modifying the PATH could be difficult with cloud hosting, I'll look into it. Thanks for the info. Not to say I'll stop looking into the Jimp issue, but it's probably a good fix for now. |
Heroku has it. Amazon EC2, you can install it from package manager at
startup of the instance, for instance via etc/rc.local
…On Thu, May 10, 2018, 4:32 PM tortilaman ***@***.***> wrote:
Ah, that might be difficult with cloud hosting. I'll look into it. Thanks
for the info.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#37 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAB9fZDaXUuMzT_aXDVRhBo_WAsYTfqgks5txKPtgaJpZM4T5J43>
.
|
Oof. I could have sworn JIMP supported GIF at some point. But, uh, no, not so far: I'd love to help make it happen, but realistically it would make more sense for us to document the limitation and double down on encouraging people to make sure they have the much, much faster imagemagick, which is available in all linux distros and all the cloud hosting solutions for which I've looked into it. |
I suppose we could do a flag to fake it, by storing the GIF as-is for all of the sizes if GIF support is not available. But then we're not checking that the GIF is valid, which is not great. |
I would think adding documentation to make the limitation clear, along with that flag to fake it is probably sufficient for now. That being said, in the thread you linked this Jimp compatible gif tool was mentioned. From an initial look it doesn't seem mature enough for production code, and I didn't see if it supports resizing. I think a more important consideration though is that when using GIFs there's always a quality/filesize compromise (or challenge) that has to be overcome before even uploading. Would resizing gifs that a user (may have) spent a lot of time optimizing cause quality/filesize or optimization issues? |
I'll work on a PR for faking it when I've got some time. |
As you pointed out, faking it won't cut it because the cropping feature is required. Your discovery of the gifwrap module looks promising. |
I've run into a very odd issue with gifs. It revolves around JIMP, but I haven't seen it mentioned there, so I'm not 100% sure yet whether the issue is with JIMP, or with this particular implementation of it.
When trying to upload a gif with
apostrophe-images
, it gives the generic image error in the browser, and on the server, it gives the following error output:Jimp knows what the MIME type is in previous functions, and has a conditional to handle
image/gif
specifically, yet when it gets here, theimage
variable is undefined. Let me know if there's more information I can provide, I'm not the best at debugging, haha.The text was updated successfully, but these errors were encountered: