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

[4.x]: Animated GIFs return null " 2x" srcset URLs even if not transformed #13635

Closed
MikeOC-8thLight opened this issue Sep 1, 2023 · 4 comments
Assignees

Comments

@MikeOC-8thLight
Copy link

MikeOC-8thLight commented Sep 1, 2023

What happened?

Description

We have a generic image rendering template which handles all manner of images (jpg, svg, gif, etc.). This has a generic transform to 'webp' which is bypassed (in template macros) for 'svg' and 'gif'. The template also provides srcset "2x" where available. This was working fine until we upgraded from 4.4.16.1 to 4.5.3, as the format was being replaced with 'null'.

Now the getSrcset function returns " 2x" with a blank URL. Only after removing the transform for all svg and gif AND removing srcset when it matches " 2x" does the image render.

transformGifs disabled in general.php and we no longer transform svg or gif sizes.

Steps to reproduce

  1. Add an entry with a gif or svg
  2. Add a transform in the template to adjust the size and format
  3. Add transformGifs => false in the config
  4. Add a img tag call with srcset enabled for '2x'
  5. You'll note that the image URL is empty

Removing the srcset attribute is not enough. Both the transform AND srcset MUST be removed in order to render the gif.

Expected behavior

Expected the gif to render according to the new size parameters and still play

Actual behavior

Srcset values are just " 2x" and no image is rendered.

Craft CMS version

4.5.3

PHP version

8.1.10

Operating system and version

Linux 5.10.0-23-cloud-amd64

Database type and version

MariaDB 10.6.9

Image driver and version

Imagick 3.7.0 (ImageMagick 6.9.11-60)

Installed plugins and versions

Amazon S3 2.0.3
Asset Rev 7.0.0
Blitz 4.5.2
Colorit 4.0.0
Colour Swatches 4.3.0
Control Panel CSS 2.6.0
Default Dashboard 2.0.0
Element API 3.0.1.1
Feed Me 5.2.0
Mix 1.6.0
Navigation 2.0.20
Neo 3.8.6
oEmbed 2.3.0
Prism 3.0.0
Redactor 3.0.4
Redactor Custom Styles 4.0.3
Redirects 4.1.13
SEO 4.2.1
Super Table 3.0.9
Twig Helper 1.0.0
Typed link field 2.1.5
Wordsmith 4.2.0

@sunscreem
Copy link

Wondering if this is related to #13624

@i-just i-just self-assigned this Sep 7, 2023
@i-just
Copy link
Contributor

i-just commented Sep 7, 2023

Hi, thanks for reporting!

Yes, this is related to #13624. I’ve further tweaked the PR created for that one to respect transformGifs and transformSvgs more fully.

That being said, I want to discuss this internally and see if any further tweaks are needed.

@sunscreem
Copy link

@i-just FYI - From the docs if you've not already spotted this:

image

@brandonkelly
Copy link
Member

Craft 4.5.4 is out with a fix for this.

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

No branches or pull requests

4 participants