rr- / szurubooru

Image board engine, Danbooru-style.
GNU General Public License v3.0
664 stars 175 forks source link

Thumbnail rework #646

Open po5 opened 3 months ago

po5 commented 3 months ago

Higher quality and lower filesize thumbnails with cjpeg (provided by mozjpeg for quality or libjpeg-turbo for speed).

Videos in the upload form now have a preview that matches the final thumbnail.

Thumbnails are now used as placeholder while the full-size image is loading on post pages.
Thumbnail stays if the full-size image load fails. If both pics fail, the transparency grid is shown (if enabled).

Videos have two thumbnails, one taken at 30% into the video (the "custom" thumbnail shown in search results), and one of the first frame (the thumbnail used as a preroll on post pages).

Images are now resized in RGB even for indexed color PNGs. It would lead to ugly dithering that also hurt compression. Before image After image

Thumbnail filenames are prefixed with sample_ to make it clear to the user they didn't download the original image.