Skip to content
Snippets Groups Projects
Commit 73110912 authored by Anusha Ranganathan's avatar Anusha Ranganathan
Browse files

Merge branch 'develop' into feature/244-enable-user-agreement

parents 86ad2ea6 43b28596
Branches
Tags
1 merge request!334Re-enable user agreement
Pipeline #17069 passed
......@@ -37,10 +37,13 @@ module Hyrax
def set_characterization_data
if file.file.content_type.include?('image')
image = MiniMagick::Image.open(file.path)
self.characterization_data[:height] = image[:height]
self.characterization_data[:width] = image[:width]
begin
image = MiniMagick::Image.open(file.path)
self.characterization_data[:height] = image[:height]
self.characterization_data[:width] = image[:width]
rescue
Rails.logger.info "Detected image MIME type, but MiniMagick failed to open or parse file \"#{file.file.original_filename}\"."
end
end
self.characterization_data[:content_type] = Marcel::Magic.by_path(file.path).to_s
......@@ -58,4 +61,4 @@ module Hyrax
end
end
end
end
\ No newline at end of file
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment