image_voodoo 0.9.2 → 0.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/image_voodoo +6 -0
- data/lib/image_voodoo/version.rb +1 -1
- data/lib/image_voodoo.rb +6 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3d24878700c42fffc45906b81ad93e9a9a401e37163a1a3681abd43412c63145
|
4
|
+
data.tar.gz: 4b6cc8ad69f184f89f59624d932e1f3b7daad8db660565d27086f4186431367d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ac6d410f3e4eb47a38ba63a631b2485e8fd6896c900b41c4542771061ca0a57ea1f16c6ca905e4907cdf5dd8aeb0184b2c062463f32173a3127a8763f719b68
|
7
|
+
data.tar.gz: 3df78c465bffd57c43b0e11434a1ffd9cd6ffff41be4a216546589085d5bb3d0f1c08570e9a4b6653959b5de516dc3230ae8fd2ca1e2650a7f932301a315f885
|
data/bin/image_voodoo
CHANGED
@@ -42,6 +42,12 @@ opts = OptionParser.new do |o|
|
|
42
42
|
actions << ->(img) { img.add_border(options) }
|
43
43
|
end
|
44
44
|
|
45
|
+
o.on('-c', '--crop X,Y,WIDTH,HEIGHT', 'Crop the image') do |args|
|
46
|
+
x, y, width, height = args.split(/,/).map(&:to_i)
|
47
|
+
|
48
|
+
actions << ->(img) { img.crop(x, y, width, height) }
|
49
|
+
end
|
50
|
+
|
45
51
|
o.on('-d', '--dimensions', 'Print the image dimensions') do
|
46
52
|
actions << ->(img) { img.tap { puts "#{img.width}x#{img.height}" } }
|
47
53
|
end
|
data/lib/image_voodoo/version.rb
CHANGED
data/lib/image_voodoo.rb
CHANGED
@@ -94,6 +94,12 @@ class ImageVoodoo
|
|
94
94
|
block_given? ? yield(target) : target
|
95
95
|
end
|
96
96
|
|
97
|
+
# crops part of an image
|
98
|
+
def crop(x, y, width, height)
|
99
|
+
target = with_crop(x, y, x + width, y + height)
|
100
|
+
block_given? ? yield(target) : target
|
101
|
+
end
|
102
|
+
|
97
103
|
# Creates a square thumbnail of the image cropping the longest edge to
|
98
104
|
# match the shortest edge, resizes to size, and yields/returns the new image.
|
99
105
|
def cropped_thumbnail(size)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: image_voodoo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thomas E. Enebo, Charles Nutter, Nick Sieger
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-12-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
@@ -148,7 +148,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
148
148
|
version: '0'
|
149
149
|
requirements:
|
150
150
|
- jar com.drewnoakes, metadata-extractor, 2.11.0
|
151
|
-
rubygems_version: 3.2.
|
151
|
+
rubygems_version: 3.2.29
|
152
152
|
signing_key:
|
153
153
|
specification_version: 4
|
154
154
|
summary: Image manipulation in JRuby with ImageScience compatible API
|