Member
Member
Roland   25-02-2021, 13:02
#1

Hello !
I'm trying to update my theme with responsive image srcset attribut
by using getCustomImageURL(); function.

Theoretically this code should be okay :

[img][/img] 640w, 916w, 1030w" sizes="(min-width: 1366px) 916px,(min-width: 1536px) 1030px, 100vw">

But's it's not working :p

The generated html is :
[img]/zenphoto/cache/Abstract/bpt6k6579564s_f3_w916.jpg?cached=1614254337[/img]

So I'm guessing, Zenphoto cache only for the src attribute.

Is this something I can trick anywhere ? Maybe theme functions ?

Thanks for your help !

Administrator
Administrator
acrylian   25-02-2021, 13:33
#2

All is fine actually. The urls you see are the image processor urls. These are only executed on request, if needed. Since the browser here picks the image size automatically it thinks is best, these are not picked and therefore not executed. The browser picks this based on teh browser window width and image widht needed for display and on page reload, not on the fly.

You can register the sizes with the cacheManager to pre-cache them manually. But this is normally not needed.

Member
Member
Roland   25-02-2021, 17:12
#3

Thanks Acrylian !!

I figured out why I had error with some pictures.
-> Because I didn't use the seo_cleanup plugin to clean files and folder names :smile:

Now it's working : https://archives.rolandtisserand.fr/cycling-amsterdam-paris/20150613-_mg_9483.jpg

I'm just a bit disappointed because the browser doesn't reload the right img on the fly. But's it's not a Zenphoto issue !

Administrator
Administrator
acrylian   25-02-2021, 17:25
#4

Good you got it working. I guess some French special chars/accents caused trouble?

I'm just a bit disappointed because the browser doesn't reload the right img on the fly.

Yeah, but after the page has been loaded it would need extra JS for that. Thus the reload. But who know what they might do in the future.

Member
Member
Roland   25-02-2021, 18:31
#5

You guess right :)

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.