mirror of
https://github.com/neocities/neocities.git
synced 2025-05-29 17:00:05 +02:00
Better error handling for screenshot and thumbnail workers, hacky fix for lets encrypt cert issue that's temporary
This commit is contained in:
parent
4382eec54b
commit
2a3b8593df
4 changed files with 25 additions and 26 deletions
|
@ -24,11 +24,20 @@ class ThumbnailWorker
|
|||
format = File.extname(path).gsub('.', '')
|
||||
full_thumbnail_path = File.join(user_thumbnails_path, "#{path}.#{res}.webp")
|
||||
|
||||
image = Rszr::Image.load site_file_path
|
||||
if image.width > image.height
|
||||
image.resize! width, :auto
|
||||
else
|
||||
image.resize! :auto, height
|
||||
begin
|
||||
image = Rszr::Image.load site_file_path
|
||||
rescue Rszr::LoadError
|
||||
next
|
||||
end
|
||||
|
||||
begin
|
||||
if image.width > image.height
|
||||
image.resize! width, :auto
|
||||
else
|
||||
image.resize! :auto, height
|
||||
end
|
||||
rescue Rszr::TransformationError
|
||||
next
|
||||
end
|
||||
|
||||
begin
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue