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

Image Scaling only works if width is given #9

Open
yanbreu opened this issue Feb 21, 2019 · 2 comments
Open

Image Scaling only works if width is given #9

yanbreu opened this issue Feb 21, 2019 · 2 comments

Comments

@yanbreu
Copy link

yanbreu commented Feb 21, 2019

At the moment if you use the Sitegeist.Kaleidoscope:AssetImageSource FusionObject and only parse a height value the scaling for the srcset is not calculating correctly. But the src is done right.
On the other side if only a width is given everything works like expected.

example:

<img
  srcset="http://localhost:8000/[...]-6600x3303-6600x512.jpg 1x,
    http://localhost:8000/[...]-6600x3303-6600x512.jpg 2x, 
    http://localhost:8000/[...]6600x3303-6600x512.jpg 3x"
  src="http://localhost:8000/[...]6600x3303-1023x512.jpg" >

Way to fix:
https://github.com/sitegeist/Sitegeist.Kaleidoscope/blob/master/Classes/EelHelpers/AssetImageSourceHelper.php#L73
Instant of } else { replace it with } else if (!$this->targetHeight) {.

Or is there any reason to don't do it?

Edit: I think it's related to this PR #1.

@mficzel
Copy link
Member

mficzel commented Sep 12, 2019

Is this still the case in recent versions like 3.2. This part was adjusted befiore and i know similar issues were solved.

@jonnitto
Copy link
Contributor

@yanbreu is this now solved? If yes, it would be great to close this issue

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

3 participants