mini_magick 4.7.2 → 4.8.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of mini_magick might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3f5606d4a6e91d6ad90a393da30244dc774e374b
4
- data.tar.gz: 71ff2a31e86426bfd514879b787fd530cf2717ad
3
+ metadata.gz: 49a53e90d9387b9fa7dbb83e10e08fcc7650e2e8
4
+ data.tar.gz: af2fecfe830084869b34bd41b6b2077b5ec4218a
5
5
  SHA512:
6
- metadata.gz: 5b17e89081bd677cd255e377c9dd22b64bc37dc467a81f4bbd0d7fde27cc552d99f3927d23ce48c9becabe37234652cd0fdd913062316fe57c3b85a003d51ad7
7
- data.tar.gz: 32d0e633b52b6d6104fa8633db9579dbe78513a3ad997737bc1506c3cc9ddb375015afbc3423fc9ee72b3fba4c710597306c167c2094f33b792f9f9c383a6d85
6
+ metadata.gz: fa011122b74d076892ae48198f56b71ab809f20bdca8d56c1a0754ccd7711c03093bcd6721b6b15aedd4599ede040ccb3d23d4947dbf4748f7531b5e68f0e5bb
7
+ data.tar.gz: 2507b667f71982f46c181a4b0ae8c55f94a2d01338f035a98e0df38ff18639b39a957bbd754c6b481e61c0a95f446e16e157e4b9562c1551f2696651c7ef22f0
@@ -76,9 +76,12 @@ module MiniMagick
76
76
  # @param path_or_url [String] Either a local file path or a URL that
77
77
  # open-uri can read
78
78
  # @param ext [String] Specify the extension you want to read it as
79
+ # @param options [Hash] Specify options for the open method
79
80
  # @return [MiniMagick::Image] The loaded image
80
81
  #
81
- def self.open(path_or_url, ext = nil)
82
+ def self.open(path_or_url, ext = nil, options = {})
83
+ options, ext = ext, nil if ext.is_a?(Hash)
84
+
82
85
  ext ||=
83
86
  if File.exist?(path_or_url)
84
87
  File.extname(path_or_url)
@@ -88,7 +91,7 @@ module MiniMagick
88
91
 
89
92
  ext.sub!(/:.*/, '') # hack for filenames or URLs that include a colon
90
93
 
91
- Kernel.open(path_or_url, "rb") do |file|
94
+ Kernel.open(path_or_url, "rb", options) do |file|
92
95
  read(file, ext)
93
96
  end
94
97
  end
@@ -343,11 +346,14 @@ module MiniMagick
343
346
  #
344
347
  # @return [Array] Matrix of each color of each pixel
345
348
  def get_pixels
346
- output = MiniMagick::Tool::Convert.new do |convert|
347
- convert << path
348
- convert.depth(8)
349
- convert << "RGB:-"
350
- end
349
+ convert = MiniMagick::Tool::Convert.new
350
+ convert << path
351
+ convert.depth(8)
352
+ convert << "RGB:-"
353
+
354
+ # Do not use `convert.call` here. We need the whole binary (unstripped) output here.
355
+ shell = MiniMagick::Shell.new
356
+ output, * = shell.run(convert.command)
351
357
 
352
358
  pixels_array = output.unpack("C*")
353
359
  pixels = pixels_array.each_slice(3).each_slice(width).to_a
@@ -92,7 +92,7 @@ module MiniMagick
92
92
  stdout, stderr, status = shell.run(command, options)
93
93
  yield stdout, stderr, status if block_given?
94
94
 
95
- stdout.strip
95
+ stdout.chomp("\n")
96
96
  end
97
97
 
98
98
  ##
@@ -8,8 +8,8 @@ module MiniMagick
8
8
 
9
9
  module VERSION
10
10
  MAJOR = 4
11
- MINOR = 7
12
- TINY = 2
11
+ MINOR = 8
12
+ TINY = 0
13
13
  PRE = nil
14
14
 
15
15
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
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.7.2
4
+ version: 4.8.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: 2017-06-20 00:00:00.000000000 Z
16
+ date: 2017-07-06 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: rake