Page 1 of 1

Posted: 2006-11-20T18:35:48-07:00
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?

Posted: 2006-11-20T21:23:14-07:00
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.