delegates.xml

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Post by magick »

Use delegates to spawn an external process to convert an image format not natively supported by ImageMagick to one that is or from an image format that is natively supported to one that is not. As an example, we use dcraw to convert the CR2 image format to TIFF. The XML looks like this:
  • <delegate decode="cr2" thread-support="False" command='"/usr/local/bin/dcraw" -T -w -c "%i" > "%o"' />
When you issue this command:
  • convert cr2:image.cr2 image.png
ImageMagick determines there is no native support for CR2 so it checks the delegate.xml configuration file and finds a match as presented above. The dcraw program is spawned and it converts the CR2 image file to TIFF. ImageMagick understands TIFF so it reads the TIFF image and subsequently converts it to PNG. Given that brief description, what exactly do you want to know about ImageMagick delegates?
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Post by anthony »

If you do not fully define the filepath of the "dcraw" executable, IM will search the for the program along the "PATH" environment variable, however this could represent a security problem.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply