Closed (fixed)
Project:
Blazy
Version:
8.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
25 Aug 2020 at 06:18 UTC
Updated:
23 Apr 2021 at 02:59 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
dennis cohn commentedComment #3
gausarts commentedThank you.
You are right.
> Why is this done?
Intriguing question. Shortly, somebody did :)
I accommodated requests from people who either need something not available, or are more knowledgeable than me.
That picture was in by request. I never worked with Picture:
#2752865: Support PICTURE element for the responsive image
My mistake, I didn't verify validity back then as I didn't need it as noted here:
This is the offending line:
https://git.drupalcode.org/project/blazy/commit/3874355#302a5e5435632d75...
$source->removeAttribute('srcset');Feel free to patch for correction. Basically
empty, notremove.Comment #4
jastraat commentedPotential patch
Comment #5
rembrandx commentedSorry, but that last patch has a mistake in it. The srcset should be set with the value from data-srcset, NOT remove it.
Added a modified patch.
EDIT: I realize this patch probably 'breaks' the lazy load functionality (as in: it loads the sources right away) but it's the only way I could get sources to actually work. Empty srcset didn't get filled in by the JS in my project. So this on's just a dirty hack and not a real fix.
Comment #6
rembrandx commentedFinally found the root cause of the JS not working, so I remade the patch properly now.
the JS was looking at the parent of the picture element instead of picture itself when looking for the srcsets
Made 2 patches:
- 1 for version 2.1
- another patch based on the current 2.x branch
Comment #7
rembrandx commentedComment #8
rembrandx commentedBlazy doesn't seem to be working in Safari (or other browses that don't support native lazy loading).
I can't figure out where it's failing, so I made an extra patch with a quick fix that just bypasses everything and applies 'src'.
This means no lazy loading in Safari but at least images get loaded.
To do: find out the root cause and fix that instead
Comment #9
rembrandx commentedComment #11
gausarts commented@jastraat, thank you for the lead!
@rembrandx, we'd better set its value to empty as done by @jastraat. If the value is set (filled-in), it will defeat the lazyload purpose.
For the Safari issue, kindly create a new thread. Your fix is truly appreciated.
Regarding the bot message "Patch Failed to Apply", likely there is a change with the latest file. You might just need to sync your local files upstream.
@Dennis Cohn, thanks again for spotting on this mistake.
Committed. Thank you for contribution and amazing patience.