remove or disable decode delegate?

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
beakman
Posts: 2
Joined: 2014-06-10T12:05:53-07:00
Authentication code: 6789

remove or disable decode delegate?

Post by beakman »

hi everyone,

I use an app that utilizes IM on the backend to generate thumbnails. We've now run into an issue where when items are added that include RAW image files (which are HUGE), the thumbnail process takes way too long. Add to that we don't even WANT those file thumbnailed. So is there any way to disable or remove the decode delegates to stop this? The app I'm using, unfortunately, doesn't let us pick and choose what filetypes to thumb, so I'm looking for a workaround.

thanks!
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: remove or disable decode delegate?

Post by Bonzo »

You can edit delegates.xml but I would think you may get errors if you remove the delegate reference. Give it a try and see what happens?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: remove or disable decode delegate?

Post by snibgo »

Another possibility: replace the delegate with one that ignores the input and creates a dummy image, say 1x1 pixel. After the conversion you could search for these and delete them.
snibgo's IM pages: im.snibgo.com
beakman
Posts: 2
Joined: 2014-06-10T12:05:53-07:00
Authentication code: 6789

Re: remove or disable decode delegate?

Post by beakman »

Bonzo wrote:You can edit delegates.xml but I would think you may get errors if you remove the delegate reference. Give it a try and see what happens?
Thanks. How would that go? Just remove any reference to RAW files? Sorry, new to (hacking) IM. :)
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: remove or disable decode delegate?

Post by Bonzo »

I belive this is the line that deals with RAW files:
<delegate decode="dng:decode" stealth="True" command="dcraw.exe -6 -w -O "%u.ppm" "%i""/>

You could check out the dcraw website and see what options may help or remove the line altogether.
crowtato
Posts: 4
Joined: 2014-07-22T10:29:28-07:00
Authentication code: 6789

Re: remove or disable decode delegate?

Post by crowtato »

Any luck, Beakman?

I've got a similar situation with another program (EMu/KE Software) that uses Imagemagick/dcraw on the backend to handle DNGs. Any time we load a DNG in EMu, a huge, slow, unnecessary(?) temporary.ppm file is created...We've tried editing the delegate code with no luck:

- replacing:
"-O "%u.ppm""
with:
"-T "%u.tiff"" (and variations on that)

deleting the "-O" or "-T" piece entirely

...All of which results in the error message: "unable to open image '.ppm': no such file or directory at blob..."


(None of the DNG metadata gets passed along either, but I'm thinking of adding "exiftool.exe -xmp:all" somewhere in the delegate...)
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: remove or disable decode delegate?

Post by magick »

Take a look in policy.xml. The docs contained within says:

Code: Select all

  Suppose we do not want users to process MPEG video images:

    <policy domain="delegate" rights="none" pattern="mpeg:decode" />

  Here we do not want users reading images from HTTP:

    <policy domain="coder" rights="none" pattern="HTTP" />
Post Reply