scale_down 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +4 -0
- data/Gemfile.lock +1 -1
- data/lib/scale_down/image.rb +3 -2
- data/lib/scale_down/version.rb +1 -1
- data/test/files/no_orient.tif +0 -0
- data/test/scale_down/image_test.rb +11 -0
- metadata +7 -5
data/CHANGES
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
== 2011-05-17 ==
|
2
|
+
Fixed a bug where images would get oriented when they should not
|
3
|
+
Adjusted the colorspacing code a bit
|
4
|
+
|
1
5
|
== 2011-05-08 ==
|
2
6
|
Removed MiniMagick and using RMagick
|
3
7
|
MiniMagick was not returning the dimensions on some images. I was able to get RMagick to work without leaking memory
|
data/Gemfile.lock
CHANGED
data/lib/scale_down/image.rb
CHANGED
@@ -78,7 +78,8 @@ class ScaleDown::Image
|
|
78
78
|
|
79
79
|
def resize(file, properties)
|
80
80
|
geo = geometry(properties)
|
81
|
-
file.auto_orient!
|
81
|
+
file.auto_orient! unless file.get_exif_by_entry("Orientation").nil?
|
82
|
+
|
82
83
|
if properties[:crop]
|
83
84
|
file.crop_resized!(geo.width, geo.height, Magick::CenterGravity)
|
84
85
|
else
|
@@ -90,7 +91,7 @@ class ScaleDown::Image
|
|
90
91
|
path = Pathname.new(file_out).dirname.to_s
|
91
92
|
FileUtils.mkdir_p path unless FileTest.directory? path
|
92
93
|
|
93
|
-
file.write(file_out) { self.quality = 85 }
|
94
|
+
file.write(file_out) { self.quality = 85; self.colorspace = Magick::RGBColorspace }
|
94
95
|
true
|
95
96
|
end
|
96
97
|
end
|
data/lib/scale_down/version.rb
CHANGED
Binary file
|
@@ -133,6 +133,17 @@ class ScaleDown::Image::Test < Test::Unit::TestCase
|
|
133
133
|
assert_equal 600, image.columns
|
134
134
|
assert_equal 800, image.rows
|
135
135
|
end
|
136
|
+
|
137
|
+
should "ignore files without orientation EXIF" do
|
138
|
+
@subject = create \
|
139
|
+
tests_path("files/no_orient.tif"),
|
140
|
+
tests_path("scaled_test/graphic_scaled.jpg"),
|
141
|
+
{ :width => "auto", :height => 424}
|
142
|
+
|
143
|
+
image = Magick::Image.read(tests_path("scaled_test/graphic_scaled.jpg")).first
|
144
|
+
assert_equal 330, image.columns
|
145
|
+
assert_equal 424, image.rows
|
146
|
+
end
|
136
147
|
end
|
137
148
|
|
138
149
|
context "CMYK images" do
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scale_down
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 3
|
10
|
+
version: 0.2.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- John Weir
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-05-
|
18
|
+
date: 2011-05-18 00:00:00 -04:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -142,6 +142,7 @@ files:
|
|
142
142
|
- test/files/cmyk_gray.jpg
|
143
143
|
- test/files/graphic.png
|
144
144
|
- test/files/invalid_jpeg.jpg
|
145
|
+
- test/files/no_orient.tif
|
145
146
|
- test/files/orient.jpg
|
146
147
|
- test/scale_down/configuration_test.rb
|
147
148
|
- test/scale_down/controller_test.rb
|
@@ -180,7 +181,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
180
181
|
requirements: []
|
181
182
|
|
182
183
|
rubyforge_project: scale_down
|
183
|
-
rubygems_version: 1.
|
184
|
+
rubygems_version: 1.4.2
|
184
185
|
signing_key:
|
185
186
|
specification_version: 3
|
186
187
|
summary: A Sinatra based server for quickly scaling and serving images. Nothing more.
|
@@ -189,6 +190,7 @@ test_files:
|
|
189
190
|
- test/files/cmyk_gray.jpg
|
190
191
|
- test/files/graphic.png
|
191
192
|
- test/files/invalid_jpeg.jpg
|
193
|
+
- test/files/no_orient.tif
|
192
194
|
- test/files/orient.jpg
|
193
195
|
- test/scale_down/configuration_test.rb
|
194
196
|
- test/scale_down/controller_test.rb
|