mirror of
https://github.com/neocities/neocities.git
synced 2025-08-01 23:31:52 +02:00
optimize screenshots and thumbnails, slight thumbnail quality reduction
This commit is contained in:
parent
841779a36c
commit
e821410d84
5 changed files with 31 additions and 3 deletions
|
@ -26,9 +26,12 @@ class ThumbnailWorker
|
|||
|
||||
save_ext = format.match(Site::LOSSY_IMAGE_REGEX) ? 'jpg' : 'png'
|
||||
|
||||
resimg.write(File.join(user_thumbnails_path, "#{path}.#{res}.#{save_ext}")) {
|
||||
self.quality = 90
|
||||
full_thumbnail_path = File.join(user_thumbnails_path, "#{path}.#{res}.#{save_ext}")
|
||||
|
||||
resimg.write(full_thumbnail_path) {
|
||||
self.quality = 75
|
||||
}
|
||||
$image_optim.optimize_image! full_thumbnail_path
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue