SHRINE WARNING: Error occurred when attempting to extract image dimensions: #<FastImage::UnknownImageType: FastImage::UnknownImageType> not using error handler #566
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
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:https://github.com/shrinerb/shrine/blob/f99fe7d10ed4c276d5afdca46194bc3ac9c76b95/lib/shrine/plugins/store_dimensions.rb#L121
System configuration
Ruby version: 2.6.6
Shrine version:
Workarount: