We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
as it happens with cropResize() (#2307), derivatives() is ignoring cropZoom().
cropResize()
derivatives()
cropZoom()
i have an image that's 2000×1000 and i want to crop it square with derivatives, so i use cropZoom:
cropZoom
{{ image.cropZoom(1000, 1000).derivatives([100, 1000, 100]) }}
the expected result would be:
<img src="[1000×1000.ext]" srcset="[100×100.ext] 100w, [200×200.ext] 200w, […], [1000×1000.ext] 1000w" […]>
instead, i get the derivatives with the proportion of the original image:
<img src="[1000×1000.ext]" srcset="[100×50.ext] 100w, [200×100.ext] 200w, […], [1000×500.ext] 1000w, [2000×1000.ext] 2000w" […]>
i haven't been able to find a workaround but to output each cropped size. any other ideas until this is resolved?
The text was updated successfully, but these errors were encountered:
@daniurx
(Grav 1.6.8) Grav\Common\Page\Medium;
line 270 public function derivatives($min_width, $max_width = 2500, $step = 200, $square = false) ... line 323 if ($square = true) { $ratio = 1; $height = $width; $derivative->zoomCrop($width, $height); } else { $derivative->resize($width, $height); }
Not nice but I need square images for image derivatives... then you could just call .derivatives(100, 1000, 100, true)
.derivatives(100, 1000, 100, true)
Sorry, something went wrong.
html()
width
height
No branches or pull requests
as it happens with
cropResize()
(#2307),derivatives()
is ignoringcropZoom()
.i have an image that's 2000×1000 and i want to crop it square with derivatives, so i use
cropZoom
:the expected result would be:
instead, i get the derivatives with the proportion of the original image:
i haven't been able to find a workaround but to output each cropped size. any other ideas until this is resolved?
The text was updated successfully, but these errors were encountered: