Gallery2:Modules:dcraw - Gallery Codex
Personal tools


From Gallery Codex

Revision as of 01:43, 10 January 2007 by H0bbel (Talk | contribs)

Dcraw Module

Toolkit to create viewable jpeg version when RAW image formats are uploaded. Requires dcraw external binary.

A precompiled linux binary (v7.86) is available at (zip). It was statically compiled and therefore should work on many linux systems. This is useful for users who do not have shell access.

Source and Windows and Mac OS X binaries can be found here.

Also see: Installing Modules with External Dependencies.

Notes & Gotchas (version 1.0.4)

For those who have version 1.0.4 installed on their galleries and attempt to upload raw digital files like NEF, MRW, CRW, etc. and are unable to access the full sized image, this is because dcraw is pulling the embedded thumbnail in the raw file.


D200 NEF raw file contains a 160x120 JPEG thumbnail embedded in the NEF file. dcraw picks up on this and the dcraw module reports the image's full size to be 160x120.

A workaround to this problem can be accomplished by making the following edit:



Find the lines that look like the following:

           $cmd = array($dcraw, '-c', '-a', '-q', '0', $sourceFilename, '>', $tmpFilename);

           $cmd = array($dcraw, '-c', '-a', '-q', $sourceFilename, '>',

And change it to:

           $cmd = array($dcraw, '-2', '-c', '-a', '-q', '0', $sourceFilename, '>', $tmpFilename);
           $cmd = array($dcraw, '-2', '-c', '-a', '-q', $sourceFilename, '>',

by adding the '-2' to the array definition. This forces the dcraw to parse the true full size of the image submitted.

This may increase the processing time for a particular large raw file or for a particular slow server, so you will want to increase the timelimit for the module:





Might be worthwhile to consider tweaking the dcraw module in the next revision to take the presence of thumbnails into account for size considerations.