For the implementation of SrcSets in my FancyBox skin, I had to replace the prefix 'srcset' by 'data-srcset':
<ja:if test="<%= (fileCategory == Category.image) %>">
"${imagePath}" <ja:if exists="imageSrcset">
<% imageSrcset= imageSrcset.replace("srcset","data-srcset"); %>
${imageSrcset} </ja:if>
</ja:if>
If that is required for more skins, it might be better to remove the 'srcset=' prefix.
In my tests , the required variants were sometimes not generated:
I start with 'WebP images' cleared and Variants Preset Clear and make the album. Album is OK.
Next I selected Presets 'Faster and better quality' which showed the settings displayed in Variant_JPG.png screenshot which is different from the very first time I used Presets 'Faster and better quality', see screenshot Variant_WebP.png.
I did generate the album, which resulted in this code:
<a data-fancybox="S" href=
"slides/Vecht%20Sahara%20140328%201005.jpg"
data-srcset="slides/Vecht%20Sahara%20140328%201005-2880w.jpg 2880w,slides/Vecht%20Sahara%20140328%201005-1920w.jpg 1920w,slides/Vecht%20Sahara%20140328%201005.jpg 1920w"
data-width="1920" data-height="1276" id="0"
However the required Variant Vecht%20Sahara%20140328%201005-1920w.jpg was not generated in the slides directory, so F12 did show the console message:
Vecht%20Sahara%20140328%201005-1920w.jpg:1 Failed to load resource: net::ERR_FILE_NOT_FOUND
.Next I deleted the slides directory and made the album again.
Now it was working OK, the variants were generated!
So SrcSets are working sometimes with the fancyBox skin.
After you repaired the Chaining function, I will test it with large albums with folders.
Edit:
As nex step I did select Preset 'faster and best quality', see screenshot FasterAndBest.png and made the album.
The genarated code was:
<a data-fancybox="S" href=
"slides/Vecht%20Sahara%20140328%201005.jpg"
data-srcset="slides/Vecht%20Sahara%20140328%201005-4912w.webp 4912w,slides/Vecht%20Sahara%20140328%201005-4912w.webp 4912w,slides/Vecht%20Sahara%20140328%201005-3840w.webp 3840w,slides/Vecht%20Sahara%20140328%201005-1920w.webp 1920w,slides/Vecht%20Sahara%20140328%201005.jpg 1920w"
data-width="1920" data-height="1276" id="0"
However it was not working, the F12 console reported
Vecht%20Sahara%20140328%201005-3840w.webp:1 Failed to load resource: net::ERR_FILE_NOT_FOUND
and indeed the slides directory did not contain any webP file, only JPG files.
Next I did delete the slides directory and made the album again.
During the make I got a warning:
The following files could not be processed due to errors:
I:\Pictures\Wandelingen\Vecht_SaharaN\MetaDataProblem_ScreenShot.jpg:
java.io.IOException: Can't write to image file
I:\Users\Andre\Documents\Mijn websites\jalbum.net\Vecht_SaharaN_FB\slides\MetaDataProblem_ScreenShot-449w.jpg
This is a small image of size 449x481.
But after the album generation, the album was correctly working.
The slides directory did contain now the required WebP files and non-used JPG files.
Edited by: AndreWolff on 4 May 2021, 12:18