Releases: minimagick/minimagick
v5.3.1
v5.3.0
v5.2.0
v5.1.2
v5.1.1
v5.1.0
-
New
cli_envconfiguration was added for setting extra environment variables for every CLI command:MiniMagick.configure do |config| config.cli_env = { "MAGICK_MEMORY_LIMIT" => "128MiB" } end
-
New
graphicsmagickconfiguration was added for telling MiniMagick to use GraphicsMagick instead of MiniMagick:MiniMagick.configure do |config| config.graphicsmagick = true # prepend all commands with "gm" end
Previously, the recommended approach was setting
MiniMagick.cli_prefix = "gm", but that doesn't work when ImageMagick 7 is installed, as in that case MiniMagick will try to prependmagickon top ofgm.
v5.0.1
-
MiniMagick::Image#writedoesn't delete the internal tempfile anymore, which restores use cases like:image = MiniMagick::Image.open("...") image.resize("500x500") image.write("foo.jpg") image.blur image.write("bar.png")
-
Prevented
MiniMagick::Image#to_arybeing called by ruby in certain cases, such as[image].flatten(1).
v5.0.0
Improvements
-
New class method shorthands were added for the tool API:
# BEFORE MiniMagick::Tool::Convert.new { |convert| ... } MiniMagick::Tool::Identify.new { |convert| ... } # ... # AFTER MiniMagick.convert { |convert| ... } MiniMagick.identify { |identify| ... } # ...
-
Image#writenow deletes the underlying tempfile ifImage.openwas used, instead of relying on the tempfile to eventually be garbage collected.
Backwards compatibility
-
Removed official GraphicsMagick support. GraphicsMagick can be used by setting
cli_prefix:MiniMagick.configure do |config| config.cli_prefix = "gm" end
Some features won't be supported, such as
MiniMagick.timeout(GraphicsMagick doesn't support time limits),Image#data(GraphicsMagick doesn't support JSON image details) andImage#exif(returns different format).As a result,
MiniMagick.cliandMiniMagick.processorconfiguration has been removed as well. -
MiniMagick::ImageandMiniMagick.convertnow usemagickinstead of the deprecatedmagick converton ImageMagick 7. This should be backwards compatible, but there might be small differences in options and behavior. -
Removed deprecated
posix-spawnshell backend, along withMiniMagick.shell_apiconfiguration.Ruby 2.x has long used vfork, so there is no performance advantage of using
posix-spawn. Additionally, Ruby 3.x has switched to non-blocking pipes, which should resolve deadlocks people experienced with Open3. See #558 for more details. -
Removed obsolete
Image#run_command. -
Removed deprecated
Image#mime_type, as it wasn't accurate.MIME type from file content should be determined either using Marcel or MimeMagic, or mime-types or MiniMime using
Image#type. -
The
MiniMagick::Tool::*classes have been deprecated in favor of the class-level interface. -
The
MiniMagick.timeoutconfiguration now uses the native ImageMagick timeout environment variable$MAGICK_TIME_LIMIT. This variable doesn't support timeouts lower than 1 second. -
The
MiniMagick.whinyconfiguration has been renamed toMiniMagick.errors. -
Images are no longer automatically validated on
Image.open,Image.readorImage.create. -
The deprecated
Image#detailsmethod has been removed in favor of the more reliableImage#data. -
The
Image#respond_to_missing?method has been removed, meaning thatImage#respond_to?will returnfalsefor ImageMagick option methods.As a result, the undocumented
MiniMagick::Tool.option_methodsmethod has been removed as well, along with the no-opMiniMagick.reload_tools. -
Removed the obsolete
MiniMagick.processor_pathconfiguration, which as mostly an alias forMiniMagick.cli_path. -
Removed the deprecated
MiniMagick.debugconfiguration in favor ofMiniMagick.logger.level = Logger::DEBUG. -
Removed the unused
MiniMagick.validate_on_writeconfiguration. -
Additional
Pathname#openorURI#openoptions forImage.openneed to be passed in as keyword arguments instead of a hash.