lwindolf / liferea

Liferea (Linux Feed Reader), a news reader for GTK/GNOME
https://lzone.de/liferea
GNU General Public License v2.0
822 stars 128 forks source link

Certain images remain as attachments #1389

Open AndyM48 opened 4 days ago

AndyM48 commented 4 days ago

I am not sure why certain images are only shown as attachments instead of being displayed in the reader pane?

As an example: https://i.guim.co.uk/img/media/799c0e3e1f1a6314ad22423b7bf8aa4ed1afd174/0_32_7952_4771/master/7952.jpg?width=460&quality=85&auto=format&fit=max&s=1327e7c6805327ee68766f935b646af6

lwindolf commented 4 days ago

Can you please provide the feed also (or a snippet of it)? Because the rendering depends on the mime type of the attachment.

AndyM48 commented 3 days ago

Sure, here you go:

Feed: https://www.theguardian.com/uk-news/rss

Item: https://www.theguardian.com/uk-news/gallery/2024/oct/25/chogm-2024-king-charles-and-queen-camilla-receive-royal-welcome-in-samoa-in-pictures

Image (1/2): https://i.guim.co.uk/img/media/f3016a202c34b502ef4147bab86cd625713a6e83/0_251_3808_2286/master/3808.jpg?width=140&quality=85&auto=format&fit=max&s=424d39dc49fba266ac8308da905dbabd Image (2/2): https://i.guim.co.uk/img/media/f3016a202c34b502ef4147bab86cd625713a6e83/0_251_3808_2286/master/3808.jpg?width=460&quality=85&auto=format&fit=max&s=c4144b4894cec99db47e316a57fab7c2

2024-10-25_10-31

lwindolf commented 1 day ago

Ah yes. That's a bit of logic. You can find it in xslt/item.xml.in. All images contained in the <description> of the RSS <item> and additionally any Gravatar image and MediaRSS thumbnails are displayed.

All images provided by the feed as <media:content> are always provided as attachment only. The reason for this choice is that those images are often the same but with different dimensions. Showing all of them never makes sense, choosing the right one is hard and feeds that do provide them usually provide a good default image.

So all in all given the feed the code works as intended.