This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 8 - Pages: 1 - Last Post: 17 Jul 23, 13:59 Last Post By: JeffTucker Threads: [ Previous | Next ]
wiesweg

Posts: 5
Registered: 9-Mar-2012
More than one output-image?
Posted: 16 Jul 23, 17:23
 
  Click to reply to this thread Reply
Question: Can jAlbum create four different slide images from an original image for output, each with a different output size?
Background: In order to cause the visitor as little internet traffic as possible, his browser should select, download and display the image from the offer that comes closest in dimension to his browser (device) window.

Concretely: Instead of using only one size previously defined in jAlbum (e.g. 2000x2000) as an image in "picture-01.html", as e.g. here:

<picture>
<img src="bild-01.webp" alt="picture 1" width="2016" height="1512">
</picture>

the browser should be offered this selection:

<picture>
<source media="(min-width:1500px)" srcset="bild-01-2000.webp" alt="Bild 1 width="2016" height="1512">
<source media="(min-width:1000px)" srcset="bild-01-1500.webp" alt="Bild 1 width="1500" height="1125">
<source media="(min-width:0500px)" srcset="bild-01-1000.webp" alt="Bild 1" width="1000" height="0750">
<source media="(min-width:0200px)" srcset="bild-01-0500.webp" alt="Bild 1" width="0500" height="0375">
<img src="bild-01-2000.webp" alt="Bild 1" width="2016" height="1512">
</picture>

The browser then selects only the image that is suitable for it.
This means more work for the webmaster, but considerably faster loading times for the visitor and good values in Google's PageSpeedTool, especially since about two-thirds of all internet traffic now takes place via smartphones.
For this case, at least three different sizes of each image have to be created with a program other than jAlbum and the content of the slide HTML file has to be changed accordingly by hand - a lot of work! See HTML source code in this example: https://wiesweg.de/ja/beispiel3/index.html

I wish jAlbum could do this in one go. It seems to me that this requires "a bit" more programming from jAlbum - could the jAlbum skin experts manage this? That would be a big step forward.

Thanks for any advice or tips or further development of jAlbum.
JeffTucker

Posts: 7,994
Registered: 31-Jan-2006
Re: More than one output-image?
Posted: 16 Jul 23, 17:50   in response to: wiesweg in response to: wiesweg
 
  Click to reply to this thread Reply
That's exactly what many jAlbum skins already do.

Rather than describe it in detail, I'll just point you to the coding in the Minimal skin, since it's a fairly simple example. Look at the supportsVariants attribute in skin.properties, then look at the coding for the slide image in slide.htt, which uses the <ja:picture> tag in jAlbum scripting language.
RobM

Posts: 3,802
Registered: 4-Aug-2006
Re: More than one output-image?
Posted: 16 Jul 23, 17:53   in response to: wiesweg in response to: wiesweg
 
  Click to reply to this thread Reply
And jAlbum lets the user select the variants, https://jalbum.net/help/en/jAlbum/Settings/Images#Variants

Edited by: RobM on 16 Jul 2023, 17:12
And how to test variants are working, https://jalbum.net/help/en/JAlbum/Glossary/V#Variants
JeffTucker

Posts: 7,994
Registered: 31-Jan-2006
Re: More than one output-image?
Posted: 16 Jul 23, 17:53   in response to: wiesweg in response to: wiesweg
 
  Click to reply to this thread Reply
wiesweg wrote:
In order to cause the visitor as little internet traffic as possible, his browser should select, download and display the image from the offer that comes closest in dimension to his browser (device) window.

While jAlbum can certainly accommodate this, my personal opinion is that it's mostly a waste of time. This is a ten-year-old solution to a ten-year-old problem. Most web hosts provide almost unlimited bandwidth. Phone users are streaming 4k video to their phones - they don't care about the bandwidth needed to show a bunch of still images.

Ultimately, you have to decide whether you're coding for Google, or coding for actual site visitors.
MarkusD

Posts: 660
Registered: 13-Apr-2006
Re: More than one output-image?
Posted: 17 Jul 23, 06:51   in response to: wiesweg in response to: wiesweg
 
  Click to reply to this thread Reply
Guten Morgen,

ich schließe mich der Empfehlung von Jeff voll und ganz an. Eine Weile habe ich auch mal mit den variants herumgespielt, in Zusammenhang mit dem damals neuen webp-Format. Mein Fazit, lass die Finger davon. Selbst wenn man Dank JA nicht viel machen muss außer ein paar Optionen zu setzen. Es ist den Aufwand nicht wert. Wie Jeff schon schrieb, kein Anwender, der ein Smartphone nutzt, interessiert die verwendete Bandbreite beim Betrachten von ein paar Photos, wenn völlig gedankenverloren 4K-Videos durch die Luft gequetscht werden um sie auf einem fitzelig kleinen Display anzuschauen.

Überhaupt gehört das Anschauen von Bildern und Videos auf einem Smartphone abgeschafft, es ist einfach nur Unsinn. Die Bildfläche ist kleiner als eine Postkarte.

Aber das ist nur meine persönliche Meinung. Gruß, Markus
wiesweg

Posts: 5
Registered: 9-Mar-2012
Re: More than one output-image?
Posted: 17 Jul 23, 07:53   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
Thanks a lot for all the ideas and advices. I will try them!

Edited by: wiesweg on 17 Jul 2023, 07:54
wiesweg

Posts: 5
Registered: 9-Mar-2012
Re: More than one output-image?
Posted: 17 Jul 23, 07:54   in response to: MarkusD in response to: MarkusD
 
  Click to reply to this thread Reply
Danke für das Feed-Back. Gute Ideen, die ich bisher noch nicht bedacht hatte.
Nachtrag: Für mich ist es jedoch wichtig, Energieverschwendung zu vermeiden: Es ist einleuchtend, das ein Foto in gleicher Qualität mit 25KB weniger Energie im Internetverkehr verbraucht als ein gleiches Foto in gleicher Qualität mit 100KB (oder mehr).
Gruß. Lothar Wiesweg

Edited by: wiesweg on 17 Jul 2023, 09:19
davidekholm

Posts: 3,432
Registered: 18-Oct-2002
Re: More than one output-image?
Posted: 17 Jul 23, 13:51   in response to: wiesweg in response to: wiesweg
 
  Click to reply to this thread Reply
We give a short and clear introduction to Variants (jAlbum's take on this) here: https://jalbum.net/blog/entry/jalbum-24-is-here
JeffTucker

Posts: 7,994
Registered: 31-Jan-2006
Re: More than one output-image?
Posted: 17 Jul 23, 13:59   in response to: wiesweg in response to: wiesweg
 
  Click to reply to this thread Reply
wiesweg wrote:
Für mich ist es jedoch wichtig, Energieverschwendung zu vermeiden....

But it takes more energy to generate multiple versions of the same image, to upload multiple files, to store and index multiple files, and to do the processing to decide which version of the image should be presented to the visitor.

And the differences are probably in the picojoule range. ;)
Legend
Forum admins
Helpful Answer
Correct Answer

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