-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Thumbnail rework #646
Draft
po5
wants to merge
18
commits into
rr-:master
Choose a base branch
from
po5:thumbnail-rework
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Thumbnail rework #646
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Indexed color PNGs would use their palette during scaling, leading to very ugly dithering. Convert to RGB32/RGB24, depending on if we intend to keep transparency. For RGB24 this sets background color from the palette if there was one, black otherwise although that may be undesirable. Will have to find a way to fall back to a nicer color, or always use the same color that we configure ourselves.
Fallback cascade: original content, thumbnail, transparency grid Implementation is very ugly but handles all cases nicely.
Saving custom thumbnails separately allows us to display them in search results etc while also displaying a thumbnail of the final content during loading.
I can see the intent, sadly this was always broken in the case where the post already has a custom thumbnail from initial load, and we don't drag any new files. It did not actually remove the existing thumbnail. Before 12c4542 it would actually crash, but this now makes it behave as expected. Also properly syncs internal state with what's displayed to the user.
Merged
neobooru
reviewed
Apr 4, 2024
background-size: 20px 20px | ||
img | ||
repeating-linear-gradient(45deg, $window-color, $window-color 10px, #e6e6e6 10px, #e6e6e6 20px) | ||
img, video |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume these changes should be taken over https://github.com/rr-/szurubooru/pull/642/files#diff-965c9ad95631d07c4423bbe276db1d09308e9d790f997c4232f3896b6405b407 right?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.