Loading images

I’ve been trying to get a feed load images with only partial success. I got some inspiration from the forum and with some of the strip_id_or_class got the image at the beginning of posts to appear. However any image inside the posts still don’t show up.

Here’s the feed on the public FTR:
http://ftr.fivefilters.net/makefulltextfeed.php?url=www.hackneycitizen.co.uk%2Fcategory%2Fnews%2Ffeed%2F

Here’s the custom config I created, basically trying to strip all classes mentioning lazy, replacing all elements mentioning lazy and not pruning anything:

replace_string(loading="false"):
replace_string(loading="lazy"):
replace_string(data-lazy-src):src
replace_string(data-lazy-loaded="1"):
strip_id_or_class: jetpack-lazy-image
strip_id_or_class: pk-lazyload
strip_id_or_class: pk-lazyloaded
strip_id_or_class: jetpack-lazy-image--handled
strip_id_or_class: lazyautosizes
prune:no

test_url: https://www.hackneycitizen.co.uk/2021/05/24/town-hall-first-glimpse-hackney-central-station-upgrade/

The top story at the moment, the one in the test_url has several images inside the story, these don’t show (only the one at the top of the post).

Any suggestion on how I can fix this properly would be appreciated.

Hi there, please try this site config file: ftr-site-config/hackneycitizen.co.uk.txt at master · fivefilters/ftr-site-config · GitHub

The site appears to have over-complicated their lazy loading. For the modern web, a regular image element with the loading attribute set to lazy is enough: <img src="[regular image URL]" loading="lazy">

The site also uses a <noscript> element which is supposed to contain elements that a browser without Javascript can render, but even this element contains image markup that requires Javascript to display.

The site config above should fix this for Full-Text RSS by renaming a few attributes.

Thank you very much for your expertise in getting to the nub of this.

I noticed that you tend to use find_string / replace_string rather than doing both with just replace_string. Do you have any rationale for this or is this just a personal preference?

No problem!

I noticed that you tend to use find_string / replace_string rather than doing both with just replace_string. Do you have any rationale for this or is this just a personal preference?

It’s mostly personal preference, but also the way Full-Text RSS parses replace_string([string-to-find]): [replacement] is quite rudimentary (splitting on the first colon found). So if [string-to-find] contains a colon, it won’t work.

So to replace src="data:image, you won’t be able to write replace_string(src="data:image): disabled-src="".

1 Like