paperclip_utils 1.0.1 → 1.0.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: 8a0899fdf1f5ba88dc1cfccaa2bc59adc756dcf2
4
- data.tar.gz: ccfff2e9c8fa0aef4016c9c9c77ecd70aaeee525
3
+ metadata.gz: c86b81304c42f601e781bc2c0bc07c9baeb22d0f
4
+ data.tar.gz: 9dbe6026170048ea023f8f86ab20412b625bee4e
5
5
  SHA512:
6
- metadata.gz: a1c6a70af2891e30bf6918a48e394a8fc570e9e2baa6ac258836520e04154458e9a2ca724336e913e43e39791a6447e4f684a6942b60a05d67aef08edbdb43f7
7
- data.tar.gz: 99a0ff3c01000b824826813ab5f2953da145f0f339a4a23c65e6344f99028b9d19d078821bdce847f321afee78e97dd94a41987b6cb01892cd5db9bd4e2a0153
6
+ metadata.gz: 65e678739fc13b6a946d42fc60e2a15dded7e49392f7d2cdc45db7907f9d68b00fb3205fbed430ebfcd635355b905c40ab78b871c4de354752ebb8607c3fa2cc
7
+ data.tar.gz: 8e528f62047b5b62a57619c9e23a013fc99beb1575a5461a583ed5eb50fe2b260c09abd0a8cbf1b1b0b9a871b35552c9a0e801f7541497120d6b58fc0947ed15
@@ -17,10 +17,17 @@ module Paperclip
17
17
  return (allowed_content_types.include?(content_type) ? processors : fallback_processors)
18
18
  end
19
19
 
20
- def self.get_styles(content_type, to_styles={preview: "800x600>", thumb: "100x100>"}, fallback_styles={}, allowed_content_types=ALLOWED_CONTENT_TYPES)
20
+ def self.get_styles(content_type, to_styles=, fallback_styles={}, allowed_content_types=ALLOWED_CONTENT_TYPES)
21
+ unless to_styles
22
+ if ['application/pdf','image/tiff','image/tif','image/x-tiff'].include?(content_type)
23
+ to_styles = {preview: ["800x600>", :png], thumb: ["100x100>", :png]}
24
+ else
25
+ to_styles = {preview: "800x600>", thumb: "100x100>"}
26
+ end
27
+ end
21
28
  return (allowed_content_types.include?(content_type) ? to_styles : fallback_styles)
22
29
  end
23
30
 
24
- ALLOWED_CONTENT_TYPES = ['application/pdf', 'image/png', 'image/x-png', 'image/gif', 'image/jpeg', 'image/pjpeg', 'image/jpg', 'image/tif, ''image/tiff', 'image/x-tiff']
31
+ ALLOWED_CONTENT_TYPES = ['application/pdf', 'image/png', 'image/x-png', 'image/gif', 'image/jpeg', 'image/pjpeg', 'image/jpg', 'image/tif', 'image/tiff', 'image/x-tiff']
25
32
  end
26
33
  end
@@ -1,3 +1,3 @@
1
1
  module PaperclipUtils
2
- VERSION = '1.0.1'
2
+ VERSION = '1.0.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.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Weston Ganger