Skip to content
Permalink
Browse files Browse the repository at this point in the history
Fix error when uploading an SVG with no size
  • Loading branch information
brian-kephart committed Oct 12, 2021
1 parent c8fe87c commit ab89584
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/uploaders/camaleon_cms_local_uploader.rb
Expand Up @@ -52,7 +52,7 @@ def file_parse(key)
if res['file_type'] == 'image'
res["thumb"].sub! '.svg', '.jpg'
im = MiniMagick::Image.open(file_path)
res['dimension'] = "#{im[:width]}x#{im[:height]}"
res['dimension'] = "#{im[:width]}x#{im[:height]}" rescue "0x0" # Malformed SVGs raise an exception here.
end
res
end
Expand Down

0 comments on commit ab89584

Please sign in to comment.