majestrate / srndv2

some random news daemon (version 2)
MIT License
19 stars 6 forks source link

use /usr/bin/identify to store information about thumbnail size #52

Closed wzeth closed 7 years ago

wzeth commented 7 years ago

Network latency and slow nodes tend to cause pages to jump since loading an image of unknown height and width causes reflow.

/usr/bin/identify is an ImageMagick command that returns the name, file type, width x height, [some weird string that has the width and height in it], bit depth (?), color space (?), file size, [some thing I don't understand], [some thing I don't understand].

$ /usr/bin/identify nntpchan.png
nntpchan.png PNG 2508x2043 2508x2043+0+0 8-bit sRGB 282KB 0.000u 0:00.000

If this information can be provided to templates, it will help improve usability.

majestrate commented 7 years ago

That would require altering the existing database schema for files and attachments and regenerating metadata for all thumbnails.

heavy operation and may not be worth it. i'll look into it.