Skip to content

Respect shr-max-image-proportion when rendering elfeed-entry#521

Open
Feyorsh wants to merge 1 commit intoskeeto:masterfrom
Feyorsh:master
Open

Respect shr-max-image-proportion when rendering elfeed-entry#521
Feyorsh wants to merge 1 commit intoskeeto:masterfrom
Feyorsh:master

Conversation

@Feyorsh
Copy link

@Feyorsh Feyorsh commented Jul 14, 2024

I noticed that Elfeed would sometimes refuse to scale down images that were too large to be displayed in a given window; after some discussion on the mailing list, I realized this is because Elfeed renders before displaying a buffer, where it can't glean any information about window size (because there's no window).

Note that there is still an issue with SVG images not respecting shr-max-image-proportion, but that has been fixed in Emacs 30 thanks to @jimporter; that's not Elfeed's problem to fix.

shr can't respect `shr-max-image-proportion` because it isn't rendered
in a window; call `elfeed-search-show-entry` first to fix this.

See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=71913

Co-authored-by: Jim Porter <jporterbugs@gmail.com>
@jimporter
Copy link

Note that there is still an issue with SVG images not respecting shr-max-image-proportion, but that has been fixed in Emacs 30 thanks to @jimporter; that's not Elfeed's problem to fix.

Emacs 31, actually, though I don't have any particular opposition to making the change in 30 too. (The code has just diverged somewhat between 30 and 31, to fix some issues with zooming images, so I'd need to write a different patch for 30.)

As for the patch, I haven't tried it myself, but from inspection it should do the right thing. Swapping the order around here shouldn't cause any problems I think: so long as there's no redisplay between the two steps (there shouldn't be), everything will be ok and there won't be anything like a flash of unrendered content.

@88-percent
Copy link

As per the mailing list mentioned, until the updates get pushed out it seems the way to get elfeed to respect shr-max-image-proportion is to disable the cache:

(setq shr-ignore-cache t)

Let me know if I'm mistaken.

@jimporter
Copy link

Let me know if I'm mistaken.

Personally, I'd just advise the function with the new implementation here. Then you can still use the image cache.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants