paperclip-compression 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/paperclip-compression/paperclip/compression.rb +5 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
M2Q3ZWIyMmIxYmI4NjdlMWU5ZTMxYmFjNGY1NWEyMjBkMTU2ZGIxNg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NjFmNjE4MmIzZWQyNGNjMzk1ODA5ZDI0YmJhOTNhZDE4NDkyZGNmZg==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
OTk3YTRhZWYyYTllOTE2Njk5ZWI0ZWMzMjU3YWM2M2UxNDQzNTQ1MmM3YjQ3
|
10
|
+
YWJmMmRiMzFiYTNmMzM3ZTFiMDUzZjU4MmEyNmFiNjhlNzBkZjYxMTEwODE3
|
11
|
+
ZTQyYzc3MmZiNmNjZTg3NWQxMDEzYjNhZGEyNjA3YzMxNmU2MDQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NDQ2Yzk2MjBiM2E2ODE1Nzk3ZTQwNThkMDg2MmI2Mzk5YzQ3OWU2MjFiNzY2
|
14
|
+
ZGE2OGRmNTBjNGE0OGExNzg3ODk0NzdmMzEwYjNjYmYwOTY5MjJjMzg4YjM3
|
15
|
+
OWNkYjgyZWNhMGU0ZTQ4ZTZjYTEwNDE4ZGUxMmViNmQ3NDYwNzY=
|
@@ -3,7 +3,7 @@ module Paperclip
|
|
3
3
|
class Compression < Processor
|
4
4
|
|
5
5
|
def make
|
6
|
-
case
|
6
|
+
case content_type
|
7
7
|
when 'image/jpeg' then make_jpeg
|
8
8
|
when 'image/png' then make_png
|
9
9
|
else
|
@@ -21,6 +21,10 @@ module Paperclip
|
|
21
21
|
PaperclipCompression::Png.make(@file, @options)
|
22
22
|
end
|
23
23
|
|
24
|
+
def content_type
|
25
|
+
@file.is_a?(Paperclip::UploadedFileAdapter) ? @file.content_type : ImageSpec.new(@file).content_type
|
26
|
+
end
|
27
|
+
|
24
28
|
end
|
25
29
|
|
26
30
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paperclip-compression
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- İ. Emre Kutlu
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-06-
|
11
|
+
date: 2013-06-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: paperclip
|