1

I'm having an issue where Craft seems to change (significantly slowing down) the framerate of animated GIF assets on upload (this doesn't seem to be an image transform problem: if I add the file as an asset in Craft, and then open the uploaded version of the file, the framerate has already changed).

The server is on the latest version of php-imagick (3.1.2) and ImageMagick (6.6.7-10) that are currently available for the version of Ubuntu that we're running (14.04 LTS)

So my question is: is there any way (config setting or similar) of preventing Craft from messing with uploaded GIFs in this way?

  • If you browse to the un-transformed asset directly, does the browser display it at the correct frame rate? e.g. domain.com/assets/gifs/file-name.gif – Matt P Apr 25 '16 at 11:10
  • No. That was what I meant by "the uploaded version of the file". Basically, adding the file to Craft as an asset seems to be the step at which the problem happens. – Nick F Apr 25 '16 at 11:21
  • Have you seen this thread: superuser.com/questions/569924/why-is-the-gif-i-created-so-slow ? – Matt P Apr 25 '16 at 11:25
  • No, I hadn't, but I'm not sure what from that I can apply to this problem... Can you be more specific? The original GIF runs at the correct framerate in the browser, so it's presumably not a browser issue or an issue with the original GIF: Craft must be doing something to the GIF. It seems to me that the solution to the problem will be getting Craft to not do that thing... – Nick F Apr 25 '16 at 11:50
  • 1
    Bug fixed in craftcms.com/changelog#build2783 – Brad Bell May 3 '16 at 16:49
4

When you upload an image to Craft, the image is automatically “cleansed” using the same basic process that Craft uses to create image transforms. That happens to ensure that there are no malicious scripts hidden in the images, and it’s not something you can disable.

| improve this answer | |
  • Hi Brandon, I know this is an old comment but we have an issue with our optimised images growing excessively when uploaded due to the call in BaseAssetSourceType to craft()->images->cleanImage() method. Whilst I understand I can FTP files up and reindex them, it is not an idea solution for a client. Most of our sites do not accept public uploads, so it would be really nice to have a config option wrapping this call, so that we can instruct the client to optimise the images before upload and the filesize be maintained. Ex. 380KB png, optimised down to 155KB, upload in craft becomes 400KB – Jay Jun 21 '17 at 15:51
  • @jay can you write into support@craftcms.com with details of your environment (PHP version, GD/Imagick version) and a sample image you're having that issue with? – Brandon Kelly Jun 22 '17 at 1:45
2

Although this issue turned out to be the result of a bug, for the record you can bypass Craft's image processing step by manually uploading an image directly to the assets folder on the server (ie. via FTP rather than Craft) and then selecting "Update Asset Indexes" in Craft's admin panel (under "Settings"). This allowed me to get the problem image up and working.

Obviously for most images it's much better - more secure, and more convenient - to upload them via Craft, but if all else fails this may be useful to know.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.