return nil if is_pdf && !gs_available?
unless File.exists?(target)
- mime_type = File.open(source) {|f| MimeMagic.by_magic(f).try(:type) }
+ mime_type = File.open(source) {|f| MimeMagic.by_magic(f).try(:type)}
return nil if mime_type.nil?
return nil if !ALLOWED_TYPES.include? mime_type
return nil if is_pdf && mime_type != "application/pdf"
# Make sure we only invoke Imagemagick if the file type is allowed
- unless File.open(source) {|f| ALLOWED_TYPES.include? MimeMagic.by_magic(f).try(:type) }
+ unless File.open(source) {|f| ALLOWED_TYPES.include? MimeMagic.by_magic(f).try(:type)}
return nil
end