mini_magick 4.9.5 → 4.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mini_magick/configuration.rb +2 -2
- data/lib/mini_magick/image.rb +31 -1
- data/lib/mini_magick/immutable_image.rb +18 -0
- data/lib/mini_magick/version.rb +2 -2
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b659ce5ff8d7c13cde3bb32ef1d33faeffe96823f7cda0385001799a224f5362
|
4
|
+
data.tar.gz: 44d1c9205e7c72677333401c79c7014202065ca1ed90a397a7a78adf5fd9da32
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff49d5ec4f216b01397ff1897fcfb820e8f223a5a992ed295209491643c1e3f3751a56b9271337083e44808265891e2a755568cdca17df7025f22ce080656a3c
|
7
|
+
data.tar.gz: 4b7adad8b9692dabecf26d86a3a61f45708fe8bd37a9580e2668b3a09b40d57d93ffca67c56404da2b738c4612ce1f786658fc92939682aedb7b67a17ea397a7
|
data/lib/mini_magick/image.rb
CHANGED
@@ -102,7 +102,11 @@ module MiniMagick
|
|
102
102
|
end
|
103
103
|
ext.sub!(/:.*/, '') # hack for filenames or URLs that include a colon
|
104
104
|
|
105
|
-
openable.
|
105
|
+
if openable.is_a?(URI::Generic)
|
106
|
+
openable.open(options) { |file| read(file, ext) }
|
107
|
+
else
|
108
|
+
openable.open(**options) { |file| read(file, ext) }
|
109
|
+
end
|
106
110
|
end
|
107
111
|
|
108
112
|
##
|
@@ -583,5 +587,31 @@ module MiniMagick
|
|
583
587
|
def layer?
|
584
588
|
path =~ /\[\d+\]$/
|
585
589
|
end
|
590
|
+
|
591
|
+
##
|
592
|
+
# Compares if image width
|
593
|
+
# is greater than height
|
594
|
+
# ============
|
595
|
+
# | |
|
596
|
+
# | |
|
597
|
+
# ============
|
598
|
+
# @return [Boolean]
|
599
|
+
def landscape?
|
600
|
+
width > height
|
601
|
+
end
|
602
|
+
|
603
|
+
##
|
604
|
+
# Compares if image height
|
605
|
+
# is greater than width
|
606
|
+
# ======
|
607
|
+
# | |
|
608
|
+
# | |
|
609
|
+
# | |
|
610
|
+
# | |
|
611
|
+
# ======
|
612
|
+
# @return [Boolean]
|
613
|
+
def portrait?
|
614
|
+
height > width
|
615
|
+
end
|
586
616
|
end
|
587
617
|
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module MiniMagick
|
2
|
+
class Image
|
3
|
+
def initialize(source)
|
4
|
+
if source.is_a?(String) || source.is_a?(Pathname)
|
5
|
+
@source_path = source.to_s
|
6
|
+
elsif source.respond_to?(:path)
|
7
|
+
@source_path = source.path
|
8
|
+
else
|
9
|
+
fail ArgumentError, "invalid source object: #{source.inspect} (expected String, Pathname or #path)"
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
def method_missing
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
image = MiniMagick::Image.new()
|
data/lib/mini_magick/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mini_magick
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Corey Johnson
|
@@ -13,7 +13,7 @@ authors:
|
|
13
13
|
autorequire:
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
|
-
date:
|
16
|
+
date: 2020-01-06 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: rake
|
@@ -118,6 +118,7 @@ files:
|
|
118
118
|
- lib/mini_magick/configuration.rb
|
119
119
|
- lib/mini_magick/image.rb
|
120
120
|
- lib/mini_magick/image/info.rb
|
121
|
+
- lib/mini_magick/immutable_image.rb
|
121
122
|
- lib/mini_magick/shell.rb
|
122
123
|
- lib/mini_magick/tool.rb
|
123
124
|
- lib/mini_magick/tool/animate.rb
|
@@ -147,7 +148,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
147
148
|
requirements:
|
148
149
|
- - ">="
|
149
150
|
- !ruby/object:Gem::Version
|
150
|
-
version: '0'
|
151
|
+
version: '2.0'
|
151
152
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
152
153
|
requirements:
|
153
154
|
- - ">="
|
@@ -155,7 +156,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
155
156
|
version: '0'
|
156
157
|
requirements:
|
157
158
|
- You must have ImageMagick or GraphicsMagick installed
|
158
|
-
rubygems_version: 3.
|
159
|
+
rubygems_version: 3.1.2
|
159
160
|
signing_key:
|
160
161
|
specification_version: 4
|
161
162
|
summary: Manipulate images with minimal use of memory via ImageMagick / GraphicsMagick
|