Skip to content
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

Failed to send a GIF file. #86

Open
diegocosta-dev opened this issue Oct 21, 2024 · 4 comments
Open

Failed to send a GIF file. #86

diegocosta-dev opened this issue Oct 21, 2024 · 4 comments

Comments

@diegocosta-dev
Copy link

Describe the bug

Is there any way to not transform GIF files?

Some gif files cannot be sent, I will leave the example.gif file to be tested.

example gif

Steps to reproduce

  1. Go to "my-site.ddev/admin/asset"
  2. Upload example.gif

image

Craft CMS version

4.12.7

Plugin version

3.0.12

Multi-site?

No

Additional context

No response

@engram-design
Copy link
Member

I thought this was supposed to be handled by ImageHelper::canManipulateAsImage, but looks like it isn't.

On the one-hand, I'd want animated GIFs to be left alone, while static GIFs should be processed. I'll look into options on that front. In either scenario, I can't get it to throw an error like that. Are you sure that's coming from Image Resizer? What are your resize limits set to?

Going one step further, I might like to include checkboxes for different file types, as I've been meaning to do for some time. For example, PNGs can often lead to fuzzy images when resized, through no fault of our own (seems an inherent Imagick and GD issue).

@diegocosta-dev
Copy link
Author

diegocosta-dev commented Oct 22, 2024

@engram-design Thanks for it.

Yes, This error happens when Image Resizer is enabled in Craft.
I tried to check the logs but I didn't find anything.

image

image-resizer.php

<?php

return [
  '*' => [
    'enabled' => true,
    'imageWidth' => 1920,
    'imageHeight' => false,
    'imageQuality' => 100,
    'skipLarger' => true,
    'nonDestructiveResize' => false,

    'assetSourceSettings' => [
      '1' => [
        'enabled' => true,
        'imageWidth' => 1920,
        'imageHeight' => false,
        'imageQuality' => 100,
        'skipLarger' => true,
        'nonDestructiveResize' => false,
      ],
    ],
  ]
];

@engram-design
Copy link
Member

So looks like Craft actually tries to resize an animated GIF frame-by-frame. I think what we're seeing here is a memory timeout.

I'll look at adding options to disable processing GIFs (or GIF + Animated GIF).

@diegocosta-dev
Copy link
Author

Thank @engram-design for that.

Just to let you know, I had already disabled the "transformGifs(false)" setting in the Craft CMS configuration file "general.php".

I’d be happy to use the "Image Resizer" again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants