Skip to content

Commit

Permalink
Fix DABBLE-ME-6X
Browse files Browse the repository at this point in the history
  • Loading branch information
parterburn committed Nov 3, 2024
1 parent cef985a commit 5675173
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/uploaders/image_uploader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ class ImageUploader < CarrierWave::Uploader::Base
# end

def process!(new_file=nil)
@original_width, @original_height = original_dimensions(new_file || file)
file_to_process = new_file || file
file_to_process = file_to_process.loader(page: 0) if pdf?(file_to_process)
@original_width, @original_height = original_dimensions(file_to_process)
super
end

Expand All @@ -35,6 +37,10 @@ def web_image?(file)
)
end

def pdf?(file)
file.content_type == 'application/pdf'
end

def heic_image?(file)
self.content_type.blank? || self.content_type == "application/octet-stream" || self.content_type == "image/heic" || self.content_type == "image/heif" || !!(self.filename =~ /^.+\.(heic|HEIC|Heic|heif|HEIF|Heif)$/i)
end
Expand Down

0 comments on commit 5675173

Please sign in to comment.