Thread Locked This thread is locked - replies are not allowed.



Permlink Replies: 100 - Pages: 7 [ Previous | 1 2 3 4 5 6 7 | Next ] - Last Post: 7 May 21, 13:30 Last Post By: davidekholm Threads: [ Previous | Next ]
ctwist

Posts: 628
Registered: 27-Sep-2003
Re: WebP support in next major version
Posted: 3 May 21, 22:37   in response to: davidekholm in response to: davidekholm
I pre-load images for the next and previous pages. This causes pages to display almost instantaneously, unless you click the "next" button very quickly. If pre-loading is used, will variants really make a difference?

I assume that most other skins use this technique. This may explain why JeffTucker gets fast response on a Galaxy S7.

BTW If anybody needs instructions on how a skin can pre-load images, start another thread and I will provide instructions.

BTW I coined the term "variant" in Mirage many years ago. My legal team is working on arranging a settlement for your shameless plagiarism. I have asked them to expedite it, so expect some demands by about 2030.
JeffTucker

Posts: 7,693
Registered: 31-Jan-2006
Re: WebP support in next major version
Posted: 3 May 21, 22:50   in response to: ctwist in response to: ctwist
ctwist wrote:
I pre-load images for the next and previous pages. This causes pages to display almost instantaneously, unless you click the "next" button very quickly. If pre-loading is used, will variants really make a difference?

I assume that most other skins use this technique. This may explain why JeffTucker gets fast response on a Galaxy S7.


Yes, I tend to forget about that. My lightbox skins are all doing various types of preloading, and I do it in my "slide page" skins. In fact, from the thumbnail page I assume that most visitors are going to click the first thumbnail, so I preload the first slide image.

But even without preloading, the slide images appear very quickly, indeed. Even with fairly large images, the slide pages load completely in under 500ms. And my web host is two time zones away.

BTW I coined the term "variant" in Mirage many years ago. My legal team is working on arranging a settlement for your shameless plagiarism. I have asked them to expedite it, so expect some demands by about 2030.

And I hear that CSS, Inc., is raising a stink about possible encroachment by jAlbum on font-variant.
AndreWolff

Posts: 1,998
Registered: 14-Dec-2007
Re: WebP support in next major version
Posted: 4 May 21, 09:36   in response to: davidekholm in response to: davidekholm
After I tested your new Minimal skin with setting 'Write WebP images' set, I cleared this check-mark and deleted all files from the output directory.

Next I did select as Variant 'Faster and best quality' and made the album.

I was surprised that the output directory did contain both jpg and webP files, although 'Write WebP images' was cleared.

I was also surprised that after I saved the settings and closed and reopened Album, the Variants preset shows '<select>' instead of the last selected 'Faster and best quality'.

BTW I would advise you to move the 'Write WebP images' check-mark from the 'Images / Advanced' to the 'Images / General' tab!
RobM

Posts: 3,483
Registered: 4-Aug-2006
Re: WebP support in next major version
Posted: 4 May 21, 11:34   in response to: AndreWolff in response to: AndreWolff
AndreWolff wrote:
After I tested your new Minimal skin with setting 'Write WebP images' set, I cleared this check-mark and deleted all files from the output directory.
You are now using jpeg images as the default.
Next I did select as Variant 'Faster and best quality' and made the album.
You have selected webp as a variant.
I was surprised that the output directory did contain both jpg and webP files, although 'Write WebP images' was cleared.
You now have a base jpeg image and whatever number of srcset webp/jpg images
I was also surprised that after I saved the settings and closed and reopened Album, the Variants preset shows '<select>' instead of the last selected 'Faster and best quality'.
It’s a beta, so not all functions will be implemented.
AndreWolff

Posts: 1,998
Registered: 14-Dec-2007
Re: WebP support in next major version
Posted: 4 May 21, 11:58   in response to: davidekholm in response to: davidekholm
Attachment Variant_JPG.png (35.9 KB)
Attachment Variant_WebP.png (36.1 KB)
Attachment FasterAndBest.png (33.5 KB)
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
AndreWolff

Posts: 1,998
Registered: 14-Dec-2007
Re: WebP support in next major version
Posted: 4 May 21, 13:05   in response to: davidekholm in response to: davidekholm
Although I have my doubts whether srcsets are usefull for thumbnails, I did implement this too in my FancyBox skin:
<img  ${thumbSrcset}  src="${thumbPath}"
This resulted in similar problems with the thumbs output directory as reported above for the slides directory:
the album generated the first time was not working, no thumbs were displayed.
After I deleted the thumbs directory and made the album again, I got more warnings:
The following files could not be processed due to errors:
I:\Pictures\Wandelingen\Vecht_SaharaN\www.youtube.com-363.webloc: java.io.IOException: Can't write to image file I:\Users\Andre\Documents\Mijn websites\jalbum.net\Vecht_SaharaN_FB\slides\www.youtube.com-363-1920w.webp
I:\Pictures\Wandelingen\Vecht_SaharaN\190918-110416_Waalenburg.jpg: java.io.IOException: Can't write to image file I:\Users\Andre\Documents\Mijn websites\jalbum.net\Vecht_SaharaN_FB\slides\190918-110416_Waalenburg-3456w.webp
I:\Pictures\Wandelingen\Vecht_SaharaN\080515_01_W2_Kioni_Anogi_360PF1.jpg: java.io.IOException: Can't write to image file I:\Users\Andre\Documents\Mijn websites\jalbum.net\Vecht_SaharaN_FB\slides\080515_01_W2_Kioni_Anogi_360PF1-16152w.webp
I:\Pictures\Wandelingen\Vecht_SaharaN\Vecht_Sahara_140328_1124.jpg: java.io.IOException: Can't write to image file I:\Users\Andre\Documents\Mijn websites\jalbum.net\Vecht_SaharaN_FB\slides\Vecht_Sahara_140328_1124-4912w.webp
I:\Pictures\Wandelingen\Vecht_SaharaN\Vecht_Sahara_140328_1151-3.jpg: java.io.IOException: Can't write to image file I:\Users\Andre\Documents\Mijn websites\jalbum.net\Vecht_SaharaN_FB\slides\Vecht_Sahara_140328_1151-3-7038w.webp
I:\Pictures\Wandelingen\Vecht_SaharaN\Vecht_Sahara_140328_1120A.jpg: java.io.IOException: Can't write to image file I:\Users\Andre\Documents\Mijn websites\jalbum.net\Vecht_SaharaN_FB\slides\Vecht_Sahara_140328_1120A.jpg
I:\Pictures\Wandelingen\Vecht_SaharaN\Vecht_Sahara_140328_1229-2.jpg: java.io.IOException: Can't write to image file I:\Users\Andre\Documents\Mijn websites\jalbum.net\Vecht_SaharaN_FB\slides\Vecht_Sahara_140328_1229-2-1920w.webp
I:\Pictures\Wandelingen\Vecht_SaharaN\Vecht_Sahara_140328_1245-3.jpg: java.io.IOException: Can't write to image file I:\Users\Andre\Documents\Mijn websites\jalbum.net\Vecht_SaharaN_FB\slides\Vecht_Sahara_140328_1245-3-5760w.webp
I:\Pictures\Wandelingen\Vecht_SaharaN\Vecht_Sahara_140328_1241-2.jpg: java.io.IOException: Can't write to image file I:\Users\Andre\Documents\Mijn websites\jalbum.net\Vecht_SaharaN_FB\slides\Vecht_Sahara_140328_1241-2.jpg

Several thumbs were not displayed in the generated album, so I think I will remove the srcSets again for thumbs!

Edit:

After I changed the display mode from Masonry to Justified Gallery and made the album, the thumbs were correctly displayed.
Next I went back to Masonry and made the album again: No warnings and the thumbs were correctly displayed!

Next I deleted again the thumbs folder and made the album again: the same warnings and non-displayed thumbs.

But after I clicked the Make button again, I got only one warning and after a next Make click, no warning and the album was displayed correctly.

Edited by: AndreWolff on 4 May 2021, 13:20
AndreWolff

Posts: 1,998
Registered: 14-Dec-2007
Re: WebP support in next major version
Posted: 4 May 21, 17:34   in response to: davidekholm in response to: davidekholm
Tests removed

Edited by: AndreWolff on 7 May 2021, 11:14
AndreWolff

Posts: 1,998
Registered: 14-Dec-2007
Re: WebP support in next major version
Posted: 4 May 21, 17:44   in response to: ctwist in response to: ctwist
ctwist wrote:
BTW If anybody needs instructions on how a skin can pre-load images, start another thread and I will provide instructions.
Good idea, see here.
davidekholm

Posts: 3,590
Registered: 18-Oct-2002
Re: WebP support in next major version
Posted: 4 May 21, 17:47   in response to: AndreWolff in response to: AndreWolff
AndreWolff wrote:
I was surprised that the output directory did contain both jpg and webP files, although 'Write WebP images' was cleared.

Still working on cleaning up state files here

I was also surprised that after I saved the settings and closed and reopened Album, the Variants preset shows '<select>' instead of the last selected 'Faster and best quality'.

That's the intended behavior actually. You can make further edits to the variants. Keeping the presets choice would then confuse matters.

BTW I would advise you to move the 'Write WebP images' check-mark from the 'Images / Advanced' to the 'Images / General' tab!

Well, I'm rather leaning towards deleting that option, and here's why:
  • Not all browsers supports WebP. We want to encourage creating compatible galleries
  • WebP images can be provided as variants now
  • jAlbum relies on the ability to embed metadata onto the generated slide images for the mechanism that determines whether an image needs to be rebuilt or not. With WebP we cannot currently embed custom metadata.
davidekholm

Posts: 3,590
Registered: 18-Oct-2002
Re: WebP support in next major version
Posted: 4 May 21, 17:52   in response to: AndreWolff in response to: AndreWolff
André. Happy to have you experimenting with this new feature. Note that it's still a beta with the following limitations:
  • Doesn't figure out when there is a need to process variants. Use "Make all" to override
  • Doesn't clean up stale/unused variants
RobM

Posts: 3,483
Registered: 4-Aug-2006
Re: WebP support in next major version
Posted: 4 May 21, 20:59   in response to: davidekholm in response to: davidekholm
When converting transparent PNGs to WEBPs the transparency is lost, shouldn't that be kept (by using the '- exact' switch)?
davidekholm

Posts: 3,590
Registered: 18-Oct-2002
Re: WebP support in next major version
Posted: 4 May 21, 21:07   in response to: RobM in response to: RobM
RobM wrote:
When converting transparent PNGs to WEBPs the transparency is lost, shouldn't that be kept (by using the '- exact' switch)?

Yes, ideally. I'll look more into transparency support and WebP soon.
davidekholm

Posts: 3,590
Registered: 18-Oct-2002
Re: WebP support in next major version
Posted: 4 May 21, 21:14   in response to: davidekholm in response to: davidekholm
Attachment Minimal.jaskin (283.5 KB)
I've now updated to v24b2. I'll package installers tomorrow, but if you like to try it now, replace lib/jalbum-core.jar with this one: https://jalbum.net/download/beta/jalbum-core.jar
and texts/texts.properties with https://jalbum.net/download/beta/texts.properties

You also need a library to handle WebP. Here's one: https://jalbum.net/download/beta/webp-imageio-0.1.7.jar

Changes:
  • Directory chaining now allows three choices: no chaining, sibling chaining and full tree chaining
  • jAlbum's engine now auto-detects when images need to be reprocessed due to adding variants, changing variant sizes or webp compression
  • jAlbum's engine now deletes stale/unused files
  • The Variants user interface is now hidden under Settings->Images and no variants will be generated for skins that don't support variants.
  • Skins that supports variants need to add the supportsVariants=true skin property to skin.properties. The attached updated Minimal skin has this addition
JeffTucker

Posts: 7,693
Registered: 31-Jan-2006
Re: WebP support in next major version
Posted: 4 May 21, 21:39   in response to: davidekholm in response to: davidekholm
davidekholm wrote:
I've now updated to v24b2.

Some debug messages are showing up in the console. Not really an issue, but those should be removed before release. Missing mydog.jpg, Missing mycat.jpg, and so on.

Directory chaining now allows three choices: no chaining, sibling chaining and full tree chaining

Appears to be working properly, but any skin that is using isChainDirectories() or setChainDirectories(boolean) will need updating, or it will blow up. That's six of mine - they're all using lightbox scripts that simply have no idea that there might be images beyond the ones called out on the current index page.

And I'm having trouble figuring out how to detect that something other than No chaining has been selected, and then resetting it.
AndreWolff

Posts: 1,998
Registered: 14-Dec-2007
Re: WebP support in next major version
Posted: 4 May 21, 22:12   in response to: davidekholm in response to: davidekholm
davidekholm wrote::
  • Directory chaining now allows three choices: no chaining, sibling chaining and full tree chaining
Full chaining works again as expected.
* jAlbum's engine now auto-detects when images need to be reprocessed due to adding variants, changing variant sizes or webp compression
  • jAlbum's engine now deletes stale/unused files
All problems I reported above have been solved in the new version.
Legend
Forum admins
Helpful Answer
Correct Answer

Point your RSS reader here for a feed of the latest messages in all forums