dragonfly 1.0.11 → 1.0.12
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of dragonfly might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/History.md +6 -0
- data/README.md +2 -2
- data/lib/dragonfly/image_magick/processors/thumb.rb +5 -2
- data/lib/dragonfly/version.rb +1 -1
- data/spec/dragonfly/image_magick/processors/thumb_spec.rb +6 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3ba96d8739fae1bd6383eefdca4c8b9ac0d92adb
|
4
|
+
data.tar.gz: 729dce87ad0b0af4625c5e346d824fab9da722e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f02d90058a7576744d706e56df923b306645505196e896b30c2eac19a5e833ddf2f803ffebc3e34640a01231e6fd4557677e7a5aec2f2d811288e768fac3d077
|
7
|
+
data.tar.gz: 2f916377721b7b7c2316c5da4a23ddd697cdedc49a5e2f2e3cb1119c33a935704dd6c03c0534e574b3ca52a565cc91c88114ac43da327ec737155b7a3b699ba7
|
data/History.md
CHANGED
data/README.md
CHANGED
@@ -10,7 +10,7 @@ class User < ActiveRecord::Base # model
|
|
10
10
|
end
|
11
11
|
```
|
12
12
|
```erb
|
13
|
-
<%= image_tag @user.photo.thumb('300x200#') # view %>
|
13
|
+
<%= image_tag @user.photo.thumb('300x200#').url # view %>
|
14
14
|
```
|
15
15
|
|
16
16
|
... or generate text images on-demand in Sinatra ...
|
@@ -44,7 +44,7 @@ Installation
|
|
44
44
|
|
45
45
|
or in your Gemfile
|
46
46
|
```ruby
|
47
|
-
gem 'dragonfly', '~> 1.0.
|
47
|
+
gem 'dragonfly', '~> 1.0.12'
|
48
48
|
```
|
49
49
|
|
50
50
|
Require with
|
@@ -26,7 +26,11 @@ module Dragonfly
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def call(content, geometry, opts={})
|
29
|
-
|
29
|
+
content.process!(:convert, args_for_geometry(geometry), opts)
|
30
|
+
end
|
31
|
+
|
32
|
+
def args_for_geometry(geometry)
|
33
|
+
case geometry
|
30
34
|
when RESIZE_GEOMETRY
|
31
35
|
resize_args(geometry)
|
32
36
|
when CROPPED_RESIZE_GEOMETRY
|
@@ -41,7 +45,6 @@ module Dragonfly
|
|
41
45
|
)
|
42
46
|
else raise ArgumentError, "Didn't recognise the geometry string #{geometry}"
|
43
47
|
end
|
44
|
-
content.process!(:convert, args, opts)
|
45
48
|
end
|
46
49
|
|
47
50
|
private
|
data/lib/dragonfly/version.rb
CHANGED
@@ -170,4 +170,10 @@ describe Dragonfly::ImageMagick::Processors::Thumb do
|
|
170
170
|
end
|
171
171
|
end
|
172
172
|
|
173
|
+
describe "args_for_geometry" do
|
174
|
+
it "returns the convert arguments used for a given geometry" do
|
175
|
+
expect(processor.args_for_geometry('30x40')).to eq('-resize 30x40')
|
176
|
+
end
|
177
|
+
end
|
178
|
+
|
173
179
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dragonfly
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Evans
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09-
|
11
|
+
date: 2015-09-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|