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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MzY5NDE1NjVmYjhmMzVjM2UxNzRhZDMyMGI4MmE0YmUxYTUwM2RiNQ==
4
+ M2Q3ZWIyMmIxYmI4NjdlMWU5ZTMxYmFjNGY1NWEyMjBkMTU2ZGIxNg==
5
5
  data.tar.gz: !binary |-
6
- MjAyNzNmMGFjNmZkMmE3ZTVlM2I1ZDM3NGE3Y2ViYjA0YzJhM2U4ZQ==
6
+ NjFmNjE4MmIzZWQyNGNjMzk1ODA5ZDI0YmJhOTNhZDE4NDkyZGNmZg==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- MzdiZDE4YmE1NjFkZjFkODdiNDFiOTk2Y2QxMzgyZDI2ZGY4OGY4NjFhZjcz
10
- NmRmMDBiNWU0MDQ0YmZjMTcwNjg2ZTZmYWUyZDAzOGQzYWIyYWM5OThhOTA5
11
- MzNlZjRiY2JlM2FlN2Q5YTRlMDM2M2NlMDEyN2I2YTZhZGI2ODE=
9
+ OTk3YTRhZWYyYTllOTE2Njk5ZWI0ZWMzMjU3YWM2M2UxNDQzNTQ1MmM3YjQ3
10
+ YWJmMmRiMzFiYTNmMzM3ZTFiMDUzZjU4MmEyNmFiNjhlNzBkZjYxMTEwODE3
11
+ ZTQyYzc3MmZiNmNjZTg3NWQxMDEzYjNhZGEyNjA3YzMxNmU2MDQ=
12
12
  data.tar.gz: !binary |-
13
- ZTAzY2FmODViMmExYzg4OTRkZWJmYWJmYTY2OTliNmUwZDY4NjM5ZGRlMzMz
14
- MGEwMDMxNDc1M2NiZjEwYzg4YWJhYzMwZTc2NzY3ZDgyMTE1MzZiNTQ4YzFl
15
- ZmEyNWVkMGUzNDEwNDBjNTJhNGE1MTgxMGI1ZDVjNmFkYzEyODA=
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 ImageSpec.new(@file).content_type
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.2
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-26 00:00:00.000000000 Z
11
+ date: 2013-06-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: paperclip