Better error handling for screenshot and thumbnail workers, hacky fix for lets encrypt cert issue that's temporary

This commit is contained in:
Kyle Drake 2023-07-19 21:16:05 +00:00
parent 4382eec54b
commit 2a3b8593df
4 changed files with 25 additions and 26 deletions

View file

@ -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