SHRINE WARNING: Error occurred when attempting to extract image dimensions: #<FastImage::UnknownImageType: FastImage::UnknownImageType> not using error handler
h0jeZvgoxFepBQ2C opened this issue · comments
Brief Description
During an image check, we get an unhandled exception:
SHRINE WARNING: Error occurred when attempting to extract image dimensions: #<FastImage::UnknownImageType: FastImage::UnknownImageType>
Expected behavior
Use the error callback
Actual behavior
Is raising an exception
Simplest self-contained example code to demonstrate issue
I guess we just have to add FastImage::UnknownImageType
to the rescue clause here:
shrine/lib/shrine/plugins/store_dimensions.rb
Line 121 in f99fe7d
System configuration
Ruby version:
2.6.6
Shrine version:
Workarount:
plugin :store_dimensions, analyzer: -> (io, analyzers) do
begin
dimensions = analyzers[:fastimage].call(io) # try extracting dimensions with FastImage
rescue => e
puts e
end
dimensions
end
Sorry, I was just wrong.