silkscreen 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/silkscreen +2 -2
- data/lib/silkscreen/version.rb +1 -1
- metadata +1 -1
data/bin/silkscreen
CHANGED
@@ -34,7 +34,7 @@ module Silkscreen
|
|
34
34
|
end
|
35
35
|
else
|
36
36
|
canvas = ChunkyPNG::Image.from_blob img
|
37
|
-
canvas.crop! 0, 0, window_width, window_height
|
37
|
+
canvas.crop! 0, 0, [window_width, canvas.width].min, [window_height, canvas.height].min
|
38
38
|
canvas = resize_canvas(canvas, options[:max_width], options[:max_height])
|
39
39
|
img = canvas.to_s
|
40
40
|
end
|
@@ -61,7 +61,7 @@ module Silkscreen
|
|
61
61
|
lower_ratio = [width_ratio, height_ratio].min
|
62
62
|
new_width = (canvas.width * lower_ratio).round
|
63
63
|
new_height = (canvas.height * lower_ratio).round
|
64
|
-
canvas.
|
64
|
+
canvas.resample_bilinear new_width, new_height
|
65
65
|
end
|
66
66
|
end
|
67
67
|
end
|
data/lib/silkscreen/version.rb
CHANGED