-
-
Notifications
You must be signed in to change notification settings - Fork 160
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
add support for jxl thumbnails #825
Conversation
I don't have time to look at this PR in detail (reading groups took all of it..), but I have a few shorthand questions:
|
On a random archive
More importantly to me at least is that it eliminates the horrible artifacting that jpeg suffers from, as seen in the comparison.
Apple has added support on both iOS/OSX and Safari (https://caniuse.com/jpegxl) For a bit more convincing of JXL's potential, here is a comparison of my whole archive before and after converting to lossless JXL
sure, that works too |
|
||
unlink $thumbname; | ||
my $jpg_thumbname = "$thumbdir/$subfolder/$id.jpg"; | ||
unlink $jpg_thumbname; |
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 am assuming unlink() doesn't care if we don't check if the file exists
unlink $jxl_thumbname; | ||
|
||
# Delete the thumbpages folder | ||
remove_tree("$thumbdir/$subfolder/$id/"); |
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 hope this is fine, before LRR did not remove the thumbpages folder when deleting an archive
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.
Yeah, I believe this was an oversight on my part back when adding thumbpages. Thanks!
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.
Just one small suggestion left from me. Thanks for the size comparisons, I'm sold! Additional GPU load is fine since we're not making JXL the default imo.
I'd forgotten Apple announced JXL support at WWDC -- It's fair to believe google will probably cave in when you look at the related chromium issue still getting comments.
Not sure I'd go as far as exposing imagemagick arguments in the UI though, that feels way overkill.
unlink $jxl_thumbname; | ||
|
||
# Delete the thumbpages folder | ||
remove_tree("$thumbdir/$subfolder/$id/"); |
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.
Yeah, I believe this was an oversight on my part back when adding thumbpages. Thanks!
Co-authored-by: Difegue <[email protected]>
BTW, while i was checking out resize_image i noticed that it serves the resized image in the same format as the original file. So jxl, avif, png, they stay the same format and don't actually use JPEG unless the original file is JPEG. |
huh, I wonder if that's not a magick behavior change in newer versions - The image resizing code is fairly old at this point, I haven't looked at how it behaves in a while. 🤔 Probably worth editing the documentation for that. Thanks for the thumbnail PR in any case, I'll be merging this! |
Congratulations @polak14, you just earned a holobyte! Here it is: https://holopin.io/holobyte/cljq5to9501970fmg24qude7m This badge can only be claimed by you, so make sure that your GitHub account is linked to your Holopin account. You can manage those preferences here: https://holopin.io/account. |
This adds an optional toggle to enable JXL thumbnails.
Why?
Saves a bit of space (~25-30% per file) and quality is superior.
thumbnail & Use high-quality thumbnails for pages enabled
Use high-quality thumbnails for pages disabled
If this is OK, it could also be a good option for the "Resize Images in Reader" function, as there the gains from JXL in size and quality would be most notable.
Caveats:
Enabling the option will regenerate all thumbnails as LRR is now looking for .jxl not .jpg.Old .jpg (or .jxl if the option is being disabled instead) files will not be deleted automatically.