Hello community,

here is the log from the commit of package rubygem-mini_magick for 
openSUSE:Factory checked in at 2017-04-11 09:40:32
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-mini_magick (Old)
 and      /work/SRC/openSUSE:Factory/.rubygem-mini_magick.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "rubygem-mini_magick"

Tue Apr 11 09:40:32 2017 rev:3 rq:484842 version:4.7.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/rubygem-mini_magick/rubygem-mini_magick.changes  
2016-12-16 11:54:54.938826478 +0100
+++ 
/work/SRC/openSUSE:Factory/.rubygem-mini_magick.new/rubygem-mini_magick.changes 
    2017-04-11 09:40:44.402570655 +0200
@@ -1,0 +2,12 @@
+Wed Mar 29 04:31:28 UTC 2017 - co...@suse.com
+
+- updated to version 4.7.0
+  no changelog found
+
+-------------------------------------------------------------------
+Mon Feb 13 05:53:49 UTC 2017 - co...@suse.com
+
+- updated to version 4.6.1
+  no changelog found
+
+-------------------------------------------------------------------

Old:
----
  mini_magick-4.6.0.gem

New:
----
  mini_magick-4.7.0.gem

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ rubygem-mini_magick.spec ++++++
--- /var/tmp/diff_new_pack.4TE9Ig/_old  2017-04-11 09:40:44.898500598 +0200
+++ /var/tmp/diff_new_pack.4TE9Ig/_new  2017-04-11 09:40:44.902500033 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package rubygem-mini_magick
 #
-# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -24,7 +24,7 @@
 #
 
 Name:           rubygem-mini_magick
-Version:        4.6.0
+Version:        4.7.0
 Release:        0
 %define mod_name mini_magick
 %define mod_full_name %{mod_name}-%{version}

++++++ mini_magick-4.6.0.gem -> mini_magick-4.7.0.gem ++++++
Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/mini_magick/image/info.rb 
new/lib/mini_magick/image/info.rb
--- old/lib/mini_magick/image/info.rb   2016-12-03 15:37:36.000000000 +0100
+++ new/lib/mini_magick/image/info.rb   2017-03-28 06:13:29.000000000 +0200
@@ -160,7 +160,9 @@
             convert << "json:"
           end
 
-          JSON.parse(json).fetch("image")
+          data = JSON.parse(json)
+          data = data.fetch(0) if data.is_a?(Array)
+          data.fetch("image")
         )
       end
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/mini_magick/image.rb new/lib/mini_magick/image.rb
--- old/lib/mini_magick/image.rb        2016-12-03 15:37:36.000000000 +0100
+++ new/lib/mini_magick/image.rb        2017-03-28 06:13:29.000000000 +0200
@@ -317,6 +317,47 @@
     alias frames layers
 
     ##
+    # Returns a matrix of pixels from the image. The matrix is constructed as
+    # an array (1) of arrays (2) of arrays (3) of unsigned integers:
+    #
+    # 1) one for each row of pixels
+    # 2) one for each column of pixels
+    # 3) three elements in the range 0-255, one for each of the RGB color 
channels
+    #
+    # @example
+    #   img = MiniMagick::Image.open 'image.jpg'
+    #   pixels = img.get_pixels
+    #   pixels[3][2][1] # the green channel value from the 4th-row, 3rd-column 
pixel
+    #
+    # It can also be called after applying transformations:
+    #
+    # @example
+    #   img = MiniMagick::Image.open 'image.jpg'
+    #   img.crop '20x30+10+5'
+    #   img.colorspace 'Gray'
+    #   pixels = img.get_pixels
+    #
+    # In this example, all pixels in pix should now have equal R, G, and B 
values.
+    #
+    # @return [Array] Matrix of each color of each pixel
+    def get_pixels
+      output = MiniMagick::Tool::Convert.new do |convert|
+        convert << path
+        convert.depth(8)
+        convert << "RGB:-"
+      end
+
+      pixels_array = output.unpack("C*")
+      pixels = pixels_array.each_slice(3).each_slice(width).to_a
+
+      # deallocate large intermediary objects
+      output.clear
+      pixels_array.clear
+
+      pixels
+    end
+
+    ##
     # This is used to change the format of the image. That is, from "tiff to
     # jpg" or something like that. Once you run it, the instance is pointing to
     # a new file with a new extension!
@@ -531,6 +572,5 @@
     def layer?
       path =~ /\[\d+\]$/
     end
-
   end
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/mini_magick/shell.rb new/lib/mini_magick/shell.rb
--- old/lib/mini_magick/shell.rb        2016-12-03 15:37:36.000000000 +0100
+++ new/lib/mini_magick/shell.rb        2017-03-28 06:13:29.000000000 +0200
@@ -13,12 +13,9 @@
     def run(command, options = {})
       stdout, stderr, status = execute(command, stdin: options[:stdin])
 
-      case status
-      when 1
+      if status != 0 && options.fetch(:whiny, MiniMagick.whiny)
         fail MiniMagick::Error, "`#{command.join(" ")}` failed with 
error:\n#{stderr}"
-      when 127
-        fail MiniMagick::Error, stderr
-      end if options.fetch(:whiny, MiniMagick.whiny)
+      end
 
       $stderr.print(stderr) unless options[:stderr] == false
 
@@ -28,9 +25,7 @@
     def execute(command, options = {})
       stdout, stderr, status =
         log(command.join(" ")) do
-          Timeout.timeout(MiniMagick.timeout) do
-            send("execute_#{MiniMagick.shell_api.gsub("-", "_")}", command, 
options)
-          end
+          send("execute_#{MiniMagick.shell_api.gsub("-", "_")}", command, 
options)
         end
 
       [stdout, stderr, status.exitstatus]
@@ -43,18 +38,38 @@
     def execute_open3(command, options = {})
       require "open3"
 
-      Open3.capture3(*command, binmode: true, stdin_data: options[:stdin].to_s)
+      in_w, out_r, err_r, subprocess_thread = Open3.popen3(*command)
+
+      capture_command(in_w, out_r, err_r, subprocess_thread, options)
     end
 
     def execute_posix_spawn(command, options = {})
       require "posix-spawn"
 
-      pid, stdin, stdout, stderr = POSIX::Spawn.popen4(*command)
-      [stdin, stdout, stderr].each(&:binmode)
-      stdin.write(options[:stdin].to_s)
-      Process.waitpid(pid)
+      pid, in_w, out_r, err_r = POSIX::Spawn.popen4(*command)
+      subprocess_thread = Process.detach(pid)
+
+      capture_command(in_w, out_r, err_r, subprocess_thread, options)
+    end
 
-      [stdout.read, stderr.read, $?]
+    def capture_command(in_w, out_r, err_r, subprocess_thread, options)
+      [in_w, out_r, err_r].each(&:binmode)
+      stdout_reader = Thread.new { out_r.read }
+      stderr_reader = Thread.new { err_r.read }
+      begin
+        in_w.write options[:stdin].to_s
+      rescue Errno::EPIPE
+      end
+      in_w.close
+
+      Timeout.timeout(MiniMagick.timeout) { subprocess_thread.join }
+
+      [stdout_reader.value, stderr_reader.value, subprocess_thread.value]
+    rescue Timeout::Error => error
+      Process.kill("TERM", subprocess_thread.pid)
+      raise error
+    ensure
+      [out_r, err_r].each(&:close)
     end
 
     def log(command, &block)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/mini_magick/version.rb 
new/lib/mini_magick/version.rb
--- old/lib/mini_magick/version.rb      2016-12-03 15:37:36.000000000 +0100
+++ new/lib/mini_magick/version.rb      2017-03-28 06:13:29.000000000 +0200
@@ -8,7 +8,7 @@
 
   module VERSION
     MAJOR = 4
-    MINOR = 6
+    MINOR = 7
     TINY  = 0
     PRE   = nil
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata        2016-12-03 15:37:36.000000000 +0100
+++ new/metadata        2017-03-28 06:13:29.000000000 +0200
@@ -1,7 +1,7 @@
 --- !ruby/object:Gem::Specification
 name: mini_magick
 version: !ruby/object:Gem::Version
-  version: 4.6.0
+  version: 4.7.0
 platform: ruby
 authors:
 - Corey Johnson
@@ -13,7 +13,7 @@
 autorequire: 
 bindir: bin
 cert_chain: []
-date: 2016-12-03 00:00:00.000000000 Z
+date: 2017-03-28 00:00:00.000000000 Z
 dependencies:
 - !ruby/object:Gem::Dependency
   name: rake
@@ -35,14 +35,42 @@
     requirements:
     - - "~>"
       - !ruby/object:Gem::Version
-        version: 3.1.0
+        version: 3.5.0
   type: :development
   prerelease: false
   version_requirements: !ruby/object:Gem::Requirement
     requirements:
     - - "~>"
       - !ruby/object:Gem::Version
-        version: 3.1.0
+        version: 3.5.0
+- !ruby/object:Gem::Dependency
+  name: guard
+  requirement: !ruby/object:Gem::Requirement
+    requirements:
+    - - ">="
+      - !ruby/object:Gem::Version
+        version: '0'
+  type: :development
+  prerelease: false
+  version_requirements: !ruby/object:Gem::Requirement
+    requirements:
+    - - ">="
+      - !ruby/object:Gem::Version
+        version: '0'
+- !ruby/object:Gem::Dependency
+  name: guard-rspec
+  requirement: !ruby/object:Gem::Requirement
+    requirements:
+    - - ">="
+      - !ruby/object:Gem::Version
+        version: '0'
+  type: :development
+  prerelease: false
+  version_requirements: !ruby/object:Gem::Requirement
+    requirements:
+    - - ">="
+      - !ruby/object:Gem::Version
+        version: '0'
 - !ruby/object:Gem::Dependency
   name: posix-spawn
   requirement: !ruby/object:Gem::Requirement


Reply via email to