this post was submitted on 18 Jun 2023
80 points (100.0% liked)

/kbin meta

200 readers
2 users here now

Magazine dedicated to discussions about the kbin itself. Provide feedback, ask questions, suggest improvements, and engage in conversations related to the platform organization, policies, features, and community dynamics. ---- * Roadmap 2023 * m/kbinDevlog * m/kbinDesign

founded 1 year ago
 

This userscript unsquashes inline images in comments by fetching the source image and downscaling it to 50%.

Requires *monkey extension to run (greasemonkey, tampermonkey, violentmonkey, et al)

Edit: also updated it to support the thread index

top 10 comments
sorted by: hot top controversial new old
[–] blobcat@kbin.social 4 points 1 year ago (1 children)

replaced https://kbin.social/m/* with https://kbin.social/* so it also fixes images on profiles

[–] shazbot@kbin.social 5 points 1 year ago* (last edited 1 year ago)

I was kind of leery of making this global because I didn't want it to affect thumbnails on the thread index, since they must be confined to a finite area, whereas in a thread they can flex downward. (The fetched image can be an arbitary size.) But it looks like they don't use the same selector, so should be safe.

Edit: I've updated it to support thread index, inline images, and profile pages and the differing aspect ratios

[–] blazera@kbin.social 2 points 1 year ago (1 children)

this removes the ability to view the full size image without auto-media preview turned on. which...also isnt a preview at all, its full size images. Wish this place had click to expand.

[–] shazbot@kbin.social 1 points 1 year ago (1 children)

Not sure I follow you. I don't have auto media preview on. This only uses the full-size images, it stops loading the downscaled thumbnails from the server. You can click to trigger a modal or you can middle click to open in new tab.

[–] blazera@kbin.social 2 points 1 year ago (2 children)

without the script, you click on the thumbnail and it opens the thread, you click the thumbnail again and it opens the full image. But with this script, the thumbnail in the thread is gone and cant be clicked.

[–] shazbot@kbin.social 2 points 1 year ago

OK, I was able to reproduce it. It doesn't apply to posts where the thumbnail is auto-extracted from an upstream page. It only applies to posts with an attached image (a meme pic etc). I've made a note to fix it.

[–] shazbot@kbin.social 1 points 1 year ago

Here's an updated version that should handle all scenarios

[–] exscape@kbin.social 2 points 1 year ago (2 children)

Hm, the thread index is the main issue for me! Might try the script and modify it.

For example: https://i.imgur.com/1e0nTx1.png

[–] shazbot@kbin.social 4 points 1 year ago

Alright, I've updated it to 0.0.5 and now it handles both inline and fixed-size index thumbnails. The thumbnails on the index get cropped to fit the hard dimensions of the squares and maintain the correct aspect ratio. In the case of inline images, they just get scaled to 50% of the original size with no constraint on the height.

[–] shazbot@kbin.social 3 points 1 year ago

Alright, those index thumbnails are confined to a 220x145 square, so we can handle those separately by using the cover method of the object-fit property to scale them. Give me a minute to update it...

load more comments
view more: next ›