diff --git a/lib/paperclip.rb b/lib/paperclip.rb index c614fff56..d44db3ce3 100644 --- a/lib/paperclip.rb +++ b/lib/paperclip.rb @@ -98,6 +98,7 @@ def self.options swallow_stderr: true, use_exif_orientation: true, whiny: true, + is_windows: Gem.win_platform? } end diff --git a/lib/paperclip/geometry_detector_factory.rb b/lib/paperclip/geometry_detector_factory.rb index a6e5282d8..9768e5a82 100644 --- a/lib/paperclip/geometry_detector_factory.rb +++ b/lib/paperclip/geometry_detector_factory.rb @@ -17,7 +17,7 @@ def geometry_string orientation = Paperclip.options[:use_exif_orientation] ? "%[exif:orientation]" : "1" Paperclip.run( - Gem.win_platform? ? "magick identify" : "identify", + Paperclip.options[:is_windows] ? "magick identify" : "identify", "-format '%wx%h,#{orientation}' :file", { :file => "#{path}[0]" }, { diff --git a/lib/paperclip/processor.rb b/lib/paperclip/processor.rb index 0bf6fe1e2..97283c5e0 100644 --- a/lib/paperclip/processor.rb +++ b/lib/paperclip/processor.rb @@ -38,7 +38,7 @@ def self.make file, options = {}, attachment = nil # See Paperclip.run for the available options. def convert(arguments = "", local_options = {}) Paperclip.run( - Gem.win_platform ? "magick convert" : "convert", + Paperclip.options[:is_windows] ? "magick convert" : "convert", arguments, local_options, ) @@ -48,7 +48,7 @@ def convert(arguments = "", local_options = {}) # See Paperclip.run for the available options. def identify(arguments = "", local_options = {}) Paperclip.run( - Gem.win_platform? ? "magick identify" : "identify", + Paperclip.options[:is_windows] ? "magick identify" : "identify", arguments, local_options, )