carrierwave-vips 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/carrierwave/vips.rb +9 -9
- metadata +116 -4
data/lib/carrierwave/vips.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
module CarrierWave
|
4
4
|
module Vips
|
5
|
-
|
5
|
+
|
6
6
|
SHARPEN_MASK = begin
|
7
7
|
conv_mask = [
|
8
8
|
[ -1, -1, -1 ],
|
@@ -11,7 +11,7 @@ module CarrierWave
|
|
11
11
|
]
|
12
12
|
::VIPS::Mask.new conv_mask, 16
|
13
13
|
end
|
14
|
-
|
14
|
+
|
15
15
|
def self.included(base)
|
16
16
|
base.send(:extend, ClassMethods)
|
17
17
|
end
|
@@ -28,11 +28,11 @@ module CarrierWave
|
|
28
28
|
def resize_to_fill(width, height)
|
29
29
|
process :resize_to_fill => [width, height]
|
30
30
|
end
|
31
|
-
|
31
|
+
|
32
32
|
def quality(percent)
|
33
33
|
process :quality => percent
|
34
34
|
end
|
35
|
-
|
35
|
+
|
36
36
|
def convert(extension)
|
37
37
|
process :convert => extension
|
38
38
|
end
|
@@ -83,7 +83,7 @@ module CarrierWave
|
|
83
83
|
@_format = f
|
84
84
|
@_format_opts = opts
|
85
85
|
end
|
86
|
-
|
86
|
+
|
87
87
|
##
|
88
88
|
# Resize the image to fit within the specified dimensions while retaining
|
89
89
|
# the original aspect ratio. The image may be shorter or narrower than
|
@@ -115,9 +115,9 @@ module CarrierWave
|
|
115
115
|
#
|
116
116
|
def resize_to_fill(new_width, new_height)
|
117
117
|
manipulate! do |image|
|
118
|
-
|
118
|
+
|
119
119
|
image = resize_image image, new_width, new_height, :max
|
120
|
-
|
120
|
+
|
121
121
|
if image.x_size > new_width
|
122
122
|
top = 0
|
123
123
|
left = (image.x_size - new_width) / 2
|
@@ -125,9 +125,9 @@ module CarrierWave
|
|
125
125
|
left = 0
|
126
126
|
top = (image.y_size - new_height) / 2
|
127
127
|
end
|
128
|
-
|
128
|
+
|
129
129
|
image.extract_area(left, top, new_width, new_height)
|
130
|
-
|
130
|
+
|
131
131
|
end
|
132
132
|
end
|
133
133
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: carrierwave-vips
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,8 +9,120 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-08-
|
13
|
-
dependencies:
|
12
|
+
date: 2012-08-13 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: ruby-vips
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 0.2.0
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 0.2.0
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: carrierwave
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
type: :runtime
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: rmagick
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :runtime
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: rspec
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
type: :development
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: dm-core
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ! '>='
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '0'
|
86
|
+
type: :development
|
87
|
+
prerelease: false
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ! '>='
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
94
|
+
- !ruby/object:Gem::Dependency
|
95
|
+
name: dm-sqlite-adapter
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
98
|
+
requirements:
|
99
|
+
- - ! '>='
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: '0'
|
102
|
+
type: :development
|
103
|
+
prerelease: false
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ! '>='
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
110
|
+
- !ruby/object:Gem::Dependency
|
111
|
+
name: dm-migrations
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
113
|
+
none: false
|
114
|
+
requirements:
|
115
|
+
- - ! '>='
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
122
|
+
requirements:
|
123
|
+
- - ! '>='
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '0'
|
14
126
|
description: Adds VIPS support to CarrierWave
|
15
127
|
email: eltiare@github.com
|
16
128
|
executables: []
|
@@ -19,7 +131,7 @@ extra_rdoc_files: []
|
|
19
131
|
files:
|
20
132
|
- lib/carrierwave-vips.rb
|
21
133
|
- lib/carrierwave/vips.rb
|
22
|
-
homepage:
|
134
|
+
homepage: https://github.com/eltiare/carrierwave-vips
|
23
135
|
licenses: []
|
24
136
|
post_install_message:
|
25
137
|
rdoc_options: []
|