Jeavon / Slimsy

Effortless Responsive & Lazy Images with LazySizes and Umbraco
MIT License
72 stars 23 forks source link

Documentation on DefaultPictureSources? #62

Closed robertjf closed 1 year ago

robertjf commented 1 year ago

Hey @Jeavon, can you provide some guidance/documentation on the following issue (since upgradng)?

image

I can't work out what is needed in the appSettings configuration to configure this...

Jeavon commented 1 year ago

Hey @robertjf

For only webp, something like this:

 "Slimsy": {
    "WidthStep": 180,
    "UseCropAsSrc": true,
    "DefaultQuality": 70,
    "TagHelper": {
      "SingleSources": [ "gif" ],
      "DefaultPictureSources": [
        {
          "Extension": "webp",
          "Quality": 70
        }
      ],
      "ImageDimensions": true
    }
  }
Jeavon commented 1 year ago

More info is here https://github.com/Jeavon/Slimsy#available-in-v41

robertjf commented 1 year ago

@Jeavon so if I configure DefaultPictureSources like that, will it convert a png to webp? As that was myunderstanding of the original render-webp-alternative attribute - it's not clear what exactly DefaultPictureSources actually does...

Jeavon commented 1 year ago

@robertjf yes it will provide a webp source element for all origin image types. It should be exactly the same as render-webp-alternative

robertjf commented 1 year ago

perfect - thanks @Jeavon :)