4

If you're not seeing WebP as a format option, your server doesn't support webp. As per the server requirements for Craft, you need either of the PHP extensions for images, GD or ImageMagick. Both of those can be compiled / installed with or without WebP (though a standard installation should include WebP by default by now). If you're working locally or on a ...


2

As far as I know, Craft only provides two controller endpoints that can be used by anonymous users to transform images, both of which won't work well in your case: AssetsController::actionThumb() – This one takes a width and a height argument, but is geared towards generating thumbnails and doesn't work well for a general purpose image resizer, and it doesn'...


2

Most likely you have AWS policy issue. Never seen the problem you've described Craft still will save images copy locally to improve speed. You can disable it using maxCachedCloudImageSize config and set it to 0.


2

Found it, this works: <img src="{{ dataUrl('@webroot' ~ myAsset.getUrl({width: 200, height: 200}, true)) }}" /> Two important things: prepend the @webroot alias to the myAsset.getUrl(...) set the second parameter of getUrl(...) to true: myAsset.getUrl({...}, true). This ensures that a real file path is returned by getUrl, because the image ...


1

You're close! When you're querying or setting a variable with a Dropdown field you need to use either .value or .label. It looks like you could also simplify your code a bit if the value (or label) of the dropdown is the same as your transform: {% for myBlock in product.imageMatrix.all() %} {% set myImage = myBlock.image.one %} {% set myTrans = ...


1

You can use Asset::setTransform or Asset::copyWithTransform to get (a copy) of the asset object with your transform applied. Then you can pass that into dataUrl(). {# Apply the transform to myAsset directly #} {% do myAsset.setTransform({width: 200, height: 200}) %} {{ dataUrl(myAsset) }} {# Use this if you need myAsset without the transform later #} {% ...


1

One method that comes to my mind is to create an asset configuration in admin panel (Settings -> Assets), where you can create different Image Transform configurations. For example, I can create an Image Transforms called Thumbnail then set the required dimensions and quality of the image. Once you create an Image Transforms, you can utilize them with ...


Only top voted, non community-wiki answers of a minimum length are eligible