paperclip_utils 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/paperclip_utils.rb +9 -2
- data/lib/paperclip_utils/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c86b81304c42f601e781bc2c0bc07c9baeb22d0f
|
4
|
+
data.tar.gz: 9dbe6026170048ea023f8f86ab20412b625bee4e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 65e678739fc13b6a946d42fc60e2a15dded7e49392f7d2cdc45db7907f9d68b00fb3205fbed430ebfcd635355b905c40ab78b871c4de354752ebb8607c3fa2cc
|
7
|
+
data.tar.gz: 8e528f62047b5b62a57619c9e23a013fc99beb1575a5461a583ed5eb50fe2b260c09abd0a8cbf1b1b0b9a871b35552c9a0e801f7541497120d6b58fc0947ed15
|
data/lib/paperclip_utils.rb
CHANGED
@@ -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
|
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, '
|
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
|