craft-snippets / Craft-image-toolbox

Craft CMS plugin that helps with the use of image transforms in templates.
Other
16 stars 0 forks source link

craft.images.picture not working #8

Closed CreateSean closed 2 years ago

CreateSean commented 2 years ago

Craft 4.0.3 Image Toolbox 2.0.0

This code was working in the C3 compatible version but since updating to C4 it no longer works.

{% set thumb = {
          mode: 'crop',
          width: 500,
          height: 500,
          quality: 75,
          position: 'center, center',
      } %}
      {% set attributes = {
        class: [
            'add classes here',
        ],
        loading:'lazy',
        alt: image.altText ?? image.title ?? null,
      } %}
    {{craft.images.picture(image, thumb, attributes) }}

using the picturemedia tag, however, does work

piotrpog commented 2 years ago

I think issue is with position setting of transform, it should build like center-center, not center, center. This is issue with craft transforms themselves not toolbox, which is just a wrapper for these (or for imager-x functions).