Class: ActiveStorage::HotCell::Server::MagickOperation

Inherits:
Operation
  • Object
show all
Defined in:
lib/active_storage/hot_cell/server/magick_operation.rb

Overview

Everything that transforms or analyses an image with ImageMagick, through mini_magick.

ImageMagick runs as an exec'd magick process that dies at the end of the call, so a decompression bomb executes in a child rather than in this worker. What this does touch in-process is mini_magick's own output — dimensions from identify, an exit status — which is a number and a string, not a decoder. The distinction is the same one probe_media draws for ffprobe.

Unlike the vips operations, the input is staged onto scratch: mini_magick spawns its own magick and does not inherit this worker's descriptors, so an input cannot be handed to it as /dev/fd. That returns the file_size ceiling to this path — an input larger than the operation's file_size dies being staged — which the vips operations shed. Removing it means driving magick directly rather than through mini_magick, and is a separate enhancement.

Constant Summary

Constants inherited from Operation

Operation::CONTENT_TYPES