paperclip_utils 1.3.1 → 1.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 93510983ef84f8e4da72f8d757ade4ec9c696446
4
- data.tar.gz: 0cd06fb83378381a7aef73ed4681be5567d75864
3
+ metadata.gz: dc7a1e0655b6c959fa19e7eb40748b8f0027b904
4
+ data.tar.gz: 8ae305ae0c4c3127cb8d7fe4f92014659b289586
5
5
  SHA512:
6
- metadata.gz: 8e68b91f79303a6c370d7c794e95e06697aa2ca3d3c6b5bdedc53013ea0ce37054334b0f3c832c0fc4653b64ba42b2f60e2bb8d3efe8a2deabdba7bdec6c027c
7
- data.tar.gz: e725ec282233f03dd1bfde3e42bf41fa319442f1e87b6de6440c45f789b4eca709b987a8facc0d750d8cc16245123c02c3808e9db225cf3f6ddc27ee731f0766
6
+ metadata.gz: 11a48acc0a21211ebe747d5969a876a0fd25d8f89019ddcaba81ab02947269ec860501a8d73973d6fd4c379e8736ee8ad6dcb3ccd0dce9db25b2a7ff1730c9f3
7
+ data.tar.gz: 73116eef3043e6967af2fced7b67dde1bc22bd2879869a2c130205bbefc7738a89db8afacf391d552f7d88432255489abfa54cd2175cbf919c3fc65ec8ea6e86
@@ -4,7 +4,7 @@ require 'paperclip_processors/ghostscript.rb'
4
4
  module Paperclip
5
5
  class Utils
6
6
  def self.get_processors(content_type, processors: [:thumbnail], fallback_processors: [], allowed_content_types: ALLOWED_CONTENT_TYPES)
7
- if processors
7
+ if processors != []
8
8
  if processors.is_a?(Array)
9
9
  if processors.include?(:thumbnail) && content_type == 'application/pdf' && !processors.include?(:ghostscript)
10
10
  processors.unshift(:ghostscript)
@@ -29,8 +29,18 @@ module Paperclip
29
29
  return (allowed_content_types.include?(content_type) ? processors : fallback_processors)
30
30
  end
31
31
 
32
- def self.get_styles(content_type, styles: {preview: "800x600>", thumb: "100x100>"}, fallback_styles: {}, allowed_content_types: ALLOWED_CONTENT_TYPES)
33
- styles ||= []
32
+ def self.get_styles(content_type, styles: {preview: "600x800>", thumb: "100x100>"}, fallback_styles: {}, allowed_content_types: ALLOWED_CONTENT_TYPES)
33
+ if styles.is_a?(Hash)
34
+ if ['application/pdf','image/tiff','image/tif','image/x-tiff'].include?(content_type)
35
+ styles.each do |k,v|
36
+ if v.is_a?(String)
37
+ styles[k] = [v, :jpg]
38
+ end
39
+ end
40
+ end
41
+ else
42
+ styles = {}
43
+ end
34
44
  return (allowed_content_types.include?(content_type) ? styles : fallback_styles)
35
45
  end
36
46
 
@@ -1,3 +1,3 @@
1
1
  module PaperclipUtils
2
- VERSION = '1.3.1'
2
+ VERSION = '1.3.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paperclip_utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Weston Ganger