Upgrading mini_magick 3 to 4
Breaking3.8.1 → 4.13.2Breaking6Security2Platform1Deprecated4New38Changed12Fixed43Other13
SecurityFixed a remote shell execution vulnerability when using MiniMagick::Image.open with URL coming from unsanitized user input.Advisory ↗
BreakingUpgrade verdict
5 breaking changes and a platform requirement change and 2 security fixes.
In plain terms
- Removed implicit queueing of commands.
- Removed deprectated methods MiniMagick::Image.from_blob and MiniMagick::Image.from_file.
- Removed MiniMagick::Image#<<.
- Removed dashed versions of processing methods, so the following won't work anymore.
Must act Top 5 of 12 that need code or config changes
Ruby requirement changed in 4.13.0: >= 0 → >= 2.3.
Drops subexec.
What you must change
Breaking5
Removed implicit queueing of commands.
image.resize("500x500")#writeMiniMagick::Image#combine_optionsRemoved deprectated methods MiniMagick::Image.from_blob and MiniMagick::Image.from_file.
MiniMagick::Image.from_blobMiniMagick::Image.from_fileRemoved MiniMagick::Image#<<.
MiniMagick::Image#<<Removed dashed versions of processing methods, so the following won't work anymore.
It currently doesn't work on JRuby.
Security2
Fixed a remote shell execution vulnerability when using MiniMagick::Image.open with URL coming from unsanitized user input.
MiniMagick::Image.openOS Command Injection in MiniMagick
High · CVSS 7.8Platform1
Requires Ruby 2.3 or newer.
Deprecations to plan for
Deprecated4
Deprecates the
posix-spawn shell backend.posix-spawnDeprecates
MiniMagick::Image#mime_type because it returns incorrect MIME types for formats not starting with image/*.MiniMagick::Image#mime_typeWhiny option should now be passed as a keyword argument.
Passing the whiny argument to MiniMagick::Tool#call is deprecated, it should now always be passed to MiniMagick::Tool.new.
MiniMagick::Tool#callMiniMagick::Tool.newAPI changes
Generated by DepDelta from published Ruby source. Not mixed with prose notes.
- removed:
static method MiniMagick.gm?() - removed:
static method MiniMagick.image_magick_version() - removed:
static method MiniMagick.minimum_image_magick_version() - removed:
static method MiniMagick.mogrify?() - removed:
static method MiniMagick.processor() - removed:
static method MiniMagick.valid_version_installed?() - removed:
static property MiniMagick.debug: accessor - removed:
static property MiniMagick.processor: accessor - removed:
static property MiniMagick.processor_path: accessor - removed:
static property MiniMagick.timeout: accessor - removed:
static property MiniMagick.validate_on_create: accessor - removed:
static property MiniMagick.validate_on_write: accessor - added:
static method MiniMagick.cli_version() - added:
static method MiniMagick.graphicsmagick?() - added:
static method MiniMagick.imagemagick7?() - added:
static method MiniMagick.imagemagick?() - added:
static method MiniMagick.with_cli(_)
- removed:
class CommandBuilder - removed:
const CommandBuilder.IMAGE_CREATION_OPERATORS - removed:
const CommandBuilder.MOGRIFY_COMMANDS - removed:
constructor CommandBuilder(_, *) - removed:
method CommandBuilder.+(*) - removed:
method CommandBuilder.add_command(_, *) - removed:
method CommandBuilder.add_creation_operator(_, *) - removed:
method CommandBuilder.args() - removed:
method CommandBuilder.command() - removed:
method CommandBuilder.format(*) - removed:
method CommandBuilder.push(_) - removed:
method Image.info(_) - removed:
method Image.mime_type() - removed:
method Image.path() - removed:
method Image.reset_queue() - removed:
method Image.run(_) - removed:
method Image.run_queue() - removed:
static method Image.from_blob(_, _ = …) - removed:
static method Image.from_file(_, _ = …) - removed:
static method Utilities.escape(_) - removed:
static method Utilities.path(_) - removed:
static method Utilities.shell_escape(_) - removed:
static method Utilities.windows?() - removed:
static method Utilities.windows_escape(_) - changed:
method Image.<<(*) → method Image.==(_) - changed:
method Image.collapse!() → method Image.collapse!(_ = …) - changed:
method Image.format(_, _ = …) → method Image.format(_, _ = …, _ = …) - changed:
property Image.path: writer → property Image.path: reader - changed:
static method Image.open(_, _ = …) → static method Image.open(_, _ = …, _ = …) - added:
class Shell - added:
class Tool - added:
const Configuration.CLI_DETECTION - added:
const Tool.CREATION_OPERATORS - added:
constructor Tool(_, _ = …) - added:
method Configuration.cli() - added:
method Configuration.cli_path() - added:
method Configuration.configure() - added:
method Configuration.processor() - added:
method Configuration.reload_tools() - added:
method Configuration.shell_api() - added:
method Image.frames() - added:
method Image.get_pixels(_ = …) - added:
method Image.hash() - added:
method Image.identify() - added:
method Image.landscape?() - added:
method Image.layer?() - added:
method Image.layers() - added:
method Image.mogrify(_ = …) - added:
method Image.pages() - added:
method Image.portrait?() - added:
method Image.validate!() - added:
method Shell.execute(_, _ = …) - added:
method Shell.run(_, _ = …) - added:
method Tool.+(*) - added:
method Tool.<<(_) - added:
method Tool.call(*) - added:
method Tool.clone(*) - added:
method Tool.command() - added:
method Tool.executable() - added:
method Tool.merge!(_) - added:
method Tool.stack(*) - added:
method Tool.stdin() - added:
method Tool.stdout() - added:
module Configuration - added:
property Configuration.cli_path: writer - added:
property Configuration.cli_prefix: accessor - added:
property Configuration.debug: reader - added:
property Configuration.logger: accessor - added:
property Configuration.processor_path: accessor - added:
property Configuration.timeout: accessor - added:
property Configuration.tmpdir: accessor - added:
property Configuration.validate_on_create: accessor - added:
property Configuration.validate_on_write: accessor - added:
property Configuration.warnings: accessor - added:
property Configuration.whiny: accessor - added:
property Image.tempfile: reader - added:
property Tool.args: reader - added:
property Tool.name: reader - added:
set Configuration.cli(_) - added:
set Configuration.debug(_) - added:
set Configuration.processor(_) - added:
set Configuration.shell_api(_) - added:
static method Image.attribute(_, _ = …) - added:
static method Image.get_image_from_pixels(_, _, _, _, _) - added:
static method Tool.new(*) - added:
static method Tool.option_methods() - added:
static method Utilities.tempfile(_)
- added:
class Info - added:
const Info.ASCII_ENCODED_EXIF_KEYS - added:
constructor Info(_) - added:
method Info.[](_, *) - added:
method Info.cheap_info(_) - added:
method Info.clear() - added:
method Info.colorspace() - added:
method Info.data() - added:
method Info.details() - added:
method Info.exif() - added:
method Info.identify() - added:
method Info.mime_type() - added:
method Info.parse_warnings(_) - added:
method Info.raw(_) - added:
method Info.raw_exif(_) - added:
method Info.resolution(_ = …) - added:
method Info.signature()
- added:
class Animate < MiniMagick::Tool - added:
class Compare < MiniMagick::Tool - added:
class Composite < MiniMagick::Tool - added:
class Conjure < MiniMagick::Tool - added:
class Convert < MiniMagick::Tool - added:
class Display < MiniMagick::Tool - added:
class Identify < MiniMagick::Tool - added:
class Import < MiniMagick::Tool - added:
class Magick < MiniMagick::Tool - added:
class Mogrify < MiniMagick::Tool - added:
class MogrifyRestricted < Mogrify - added:
class Montage < MiniMagick::Tool - added:
class Stream < MiniMagick::Tool - added:
constructor Animate(*) - added:
constructor Compare(*) - added:
constructor Composite(*) - added:
constructor Conjure(*) - added:
constructor Convert(*) - added:
constructor Display(*) - added:
constructor Identify(*) - added:
constructor Import(*) - added:
constructor Magick(*) - added:
constructor Mogrify(*) - added:
constructor Montage(*) - added:
constructor Stream(*) - added:
method MogrifyRestricted.format(*)