minimagick

mini replacement for RMagick

MIT License

Downloads
233.4M
Stars
2.8K
Committers
121

Bot releases are hidden (Show)

minimagick - Latest Release

Published by janko almost 2 years ago

  • Added new tmpdir configuration, which defaults to Dir.tmpdir (#541)
    MiniMagick.configure do |config|
      config.tmpdir = File.join(Dir.tmpdir, "/my/new/tmp_dir")
    end
    
  • Don't leave temporary files lying around when MiniMagick::Image#format failed (#547)
  • Replace File.exists? with File.exist?, which should fix Ruby 3.2 compatibility (#550)
  • Fixed a case where the log could not be parsed correctly when there were multiple lines (#540)
  • Added status to the exception message when the ImageMagick command fails (#542)
  • Allow passing format to Image#get_pixels so we can request "RGBA" pixels (#537)
  • Suppress warning to ambiguous argument (#529)
  • Use Thread#join with a timeout argument instead of the Timeout standard library (#525)
minimagick -

Published by janko almost 4 years ago

  • Fix fetching metadata when there are GhostScript warnings (#522)
  • Fixed some method redefined warnings (#505)
  • Added MiniMagick::Image.get_image_from_pixels (#516)
  • extend MiniMagick::Tool#stack to support arguments so that it can be used with Active Storage
minimagick -

Published by janko almost 5 years ago

  • Still pick up ImageMagick over GraphicsMagick if both are installed
minimagick -

Published by janko almost 5 years ago

  • Prioritize discovery of ImageMagick 7 over 6 if both are installed (@drnic)
  • Add MiniMagick::Image#landscape? and #portrait? methods for checking orientiation (@theomarkkuspaul)
  • Fix Ruby 2.7 warnings (@kamipo)
minimagick -

Published by janko over 5 years ago

  • Fixed MiniMagick::Image.open not working with non-ASCII filenames anymore after previous version (thanks to @meganemura)
minimagick -

Published by janko over 5 years ago

  • Fixed a remote shell execution vulnerability when using MiniMagick::Image.open with URL coming from unsanitized user input (thanks to @rootxharsh)
  • Fixed some Ruby warnings (thanks to @koic)
minimagick -

Published by janko over 5 years ago

  • make MiniMagick::Tool not respond to everything
minimagick -

Published by janko about 6 years ago

  • Fix breakage for MRI 2.3 and below
minimagick -

Published by janko about 6 years ago

  • Properly handle EXIF parsing with ImageMagick 7
  • Show an informative exception message on Timeout::Error
  • Wait for the MiniMagick command to terminate after sending SIGTERM with open3
minimagick -

Published by janko about 6 years ago

New features

  • Support ImageMagick 7

    • MiniMagick::Tool::Convert will now generate magick convert commands (and the same for others)
    • MiniMagick::Tool::Magick was added for generating magick commands
  • MiniMagick.cli_prefix was added to configure a prefix for commands

    MiniMagick.cli_prefix = "firejail"
    
    MiniMagick::Tool::Magick.new { |magick| ... } # executes `firejail magick ...`
    

Other Improvements

  • Fix deadlocks when using posix-spawn as a shell backend

  • Fix Errno::ESRCH sometimes being raised when the ImageMagick command would time out

  • #label and #caption will now generate regular options

    MiniMagick::Tool::Convert.new do |convert|
                             # BEFORE:       NOW:
      convert.label("foo")   # label:foo    -label foo
      convert.caption("bar") # caption:bar  -caption bar
    end
    
  • Add pango creation operator

    MiniMagick::Tool::Magick.new do |magick|
      magick.pango("...") # pango:...
      # ...
    end
    
  • Handle GraphicsMagick returning unknown in EXIF data

minimagick -

Published by janko over 7 years ago

  • Add options to MiniMagick::Image.open which are forwarded to open-uri when URL is used (@acrogenesis)
  • Fixed MiniMagick::Image#get_pixels not returning all pixels for images that have first or last bytes that could be interpreted as control characters in their RGB output (@LAndreas)
minimagick -

Published by janko over 7 years ago

  • Avoid defining methods at runtime whenever a processing method is invoked, which means that Ruby can keep its method cache, instead of having to clear it on each processing invocation (thanks to @printercu).
minimagick -

Published by janko over 7 years ago

  • Fix errors when calling MiniMagick::Image.open with URLs like https://pbs.twimg.com/media/DCOD2DXVwAI4xsL.jpg:large, where the : would get included in the file extension and cause errors with some ImageMagick commands due to : being a special character to ImageMagick.
minimagick -

Published by janko over 7 years ago

  • Added MiniMagick::Image#get_pixels, which returns a matrix where each member is a 3-element array of numbers between 0 and 255, one for each of the RGB channels.
  • When MiniMagick.timeout is set and the command times out, previously the command would still continue running in the background. Now when Timeout::Error is raised, we also kill the subprocess running the command with SIGTERM.
  • Implementation of posix-spawn has been improved, where now both stdout and stderr are read from at the same time, stdin pipe is closed immediately after writing the input, and stdout and stderr pipes are closed once the command finishes. This now has essentially the same behaivour as Open3.popen3 with a block.
minimagick -

Published by janko over 7 years ago

  • Fixed MiniMagick::Image#data to be work for multilayer images where array is returned as the JSON representation (@bytheway875)
  • Fixed stdout and stderr buffer overload that can happen when processing many images using posix-spawn (@lest)
minimagick -

Published by janko almost 8 years ago

  • Fix Image#exif raising an error when an exif value contains a "=" chracter
  • Fix Image#exif raising an error when an exif value spans on multiple lines
  • Introduced Image#data as an alternative to Image#details, which uses ImageMagick's ability to retrieve identify -verbose output in JSON format. This eliminates possibility of any parsing errors. It is available on ImageMagick 6.8.8-3 or above.
  • Allow Image#format to accept a hash of options as a third argument, which will be added to the convert command before original path is added
  • Support Pathname in Image.new, as we already supported Pathname in Image.open
  • Added Tool#stdout which adds - to the command (the same as Tool#stdin does)
minimagick -

Published by janko over 8 years ago

  • Fixed MiniMagick logging commands by default
minimagick -

Published by janko over 8 years ago

New features

  • Added the ability for ImageMagick commands to accept standard input:

    identify = MiniMagick::Tool::Identify.new
    identify.stdin # adds "-"
    identify.call(stdin: image_content)
    
  • Added ability to capture stdout, stderr and exist status by passing a block to MiniMagick::Tool#call:

    compare = MiniMagick::Tool::Compare.new
    # build the command
    compare.call do |stdout, stderr, status|
      # ...
    end
    
  • Added ability to assign MiniMagick.logger to Rails.logger

Bug fixes

  • The value of MiniMagick.whiny configuration option is now respected
  • The new filename when calling #format is now generated better when calling on a layer
  • Delete *.cache files generated by .mpc files when deleting MiniMagick::Image

Deprecations

  • Whiny option should now be passed as a keyword argument:

    MiniMagick::Tool::Identify.new(false) # deprecated
    MiniMagick::Tool::Identify.new(whiny: false) # good
    
  • Passing the whiny argument to MiniMagick::Tool#call is deprecated, it should now always be passed to MiniMagick::Tool.new

minimagick -

Published by janko over 8 years ago

  • Using MiniMagick::Image#format now works when the image instance is a layer/frame/page.
  • Calling MiniMagick::Tool#clone as a way of adding the -clone CLI option now works properly (before it would call Object#clone).
  • Badly encoded lines in identify -verbose don't cause an error anymore in MiniMagick::Image#details.
  • MiniMagick::Image#details doesn't hang anymore when clipping paths are present
  • Added MiniMagick::Image#tempfile for accessing the underlying temporary file.
minimagick -

Published by janko about 9 years ago

  • Restore the old behaviour of MiniMagick::Image#respond_to? by looking at mogrify -help and finding the method. This restores compatibilty with CarrierWave.