szurubooru
szurubooru copied to clipboard
Thumbnail rework
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
After
Thumbnail filenames are prefixed with sample_
to make it clear to the user they didn't download the original image.