ConvertX icon indicating copy to clipboard operation
ConvertX copied to clipboard

Unable to convert : dcraw not found

Open Kitof opened this issue 1 year ago • 7 comments

Hi,

I'm unable to convert .NEF to . JPG after a fresh docker install :

convertx  | stderr: sh: dcraw: not found
convertx  | gm convert: "dcraw" -c -w -6 -T "./data/uploads/1/1/DSC_0880.NEF" > "/tmp/gmSkKQBu".
convertx  | gm convert: Delegate failed ("dcraw" -c -w -6 -T "%i" > "%o").
convertx  | 
convertx  | Failed to convert ./data/uploads/1/1/DSC_0880.NEF from nef to jpeg using graphicsmagick. error: Error: Command failed: gm convert "./data/uploads/1/1/DSC_0880.NEF" "./data/output/1/1/DSC_0880.jpg"
convertx  | sh: dcraw: not found
convertx  | gm convert: "dcraw" -c -w -6 -T "./data/uploads/1/1/DSC_0880.NEF" > "/tmp/gmSkKQBu".
convertx  | gm convert: Delegate failed ("dcraw" -c -w -6 -T "%i" > "%o").

Any helps appreciated, thanks.

Kitof avatar Dec 23 '24 16:12 Kitof

I thought graphicsmagick bundled dcraw but it seems like it don't. Maybe it is fixed in later versions of gm, could you test that?

C4illin avatar Jan 07 '25 09:01 C4illin

dcraw should be compiled and added separately as add-on to GraphicsMagick according their official web page. Sombody already did something like that

borekon avatar Mar 25 '25 08:03 borekon

I'm getting this same error now with the latest Dockerized version trying to convert a DNG Apple to jpg/png. convertx | stderr: sh: dcraw: not found convertx | gm convert: "dcraw" -c -w -6 -T "./data/uploads/1/4/IMG_9090.DNG" > "/tmp/gm8jjsMx". convertx | gm convert: Delegate failed ("dcraw" -c -w -6 -T "%i" > "%o"). convertx | convertx | Failed to convert ./data/uploads/1/4/IMG_9090.DNG from dng to jpeg using graphicsmagick. error: Error: Command failed: gm convert ./data/uploads/1/4/IMG_9090.DNG ./data/output/1/4/IMG_9090.jpg convertx | sh: dcraw: not found convertx | gm convert: "dcraw" -c -w -6 -T "./data/uploads/1/4/IMG_9090.DNG" > "/tmp/gm8jjsMx". convertx | gm convert: Delegate failed ("dcraw" -c -w -6 -T "%i" > "%o"). convertx | convertx | stderr: sh: dcraw: not found convertx | gm convert: "dcraw" -c -w -6 -T "./data/uploads/1/4/IMG_9091.DNG" > "/tmp/gmyc8c5V". convertx | gm convert: Delegate failed ("dcraw" -c -w -6 -T "%i" > "%o"). convertx | convertx | Failed to convert ./data/uploads/1/4/IMG_9091.DNG from dng to jpeg using graphicsmagick. error: Error: Command failed: gm convert ./data/uploads/1/4/IMG_9091.DNG ./data/output/1/4/IMG_9091.jpg convertx | sh: dcraw: not found convertx | gm convert: "dcraw" -c -w -6 -T "./data/uploads/1/4/IMG_9091.DNG" > "/tmp/gmyc8c5V". convertx | gm convert: Delegate failed ("dcraw" -c -w -6 -T "%i" > "%o").

a10kiloham avatar May 14 '25 16:05 a10kiloham

oof i just tried to push a commit but this thing does not want to build on alpine linux! has anyone successfully done it? i can use apk add dcraw but then it throws up linker errors which lead to adding many many more packages and then it still doesn't install as expected for me. weird.

e11b87d593f9:/app# apk add libkdcraw
(1/31) Installing libpcre2-16 (10.43-r0)
(2/31) Installing qt5-qtbase (5.15.10_git20230714-r2)
(3/31) Installing libmagic (5.45-r1)
(4/31) Installing file (5.45-r1)
(5/31) Installing xprop (1.2.7-r0)
(6/31) Installing libxmu (1.1.4-r2)
(7/31) Installing xset (1.2.5-r1)
(8/31) Installing xdg-utils (1.2.1-r0)
(9/31) Installing mesa (24.0.9-r1)
(10/31) Installing wayland-libs-server (1.22.0-r4)
(11/31) Installing libxxf86vm (1.1.5-r6)
(12/31) Installing mesa-glapi (24.0.9-r1)
(13/31) Installing libxshmfence (1.3.2-r6)
(14/31) Installing mesa-gl (24.0.9-r1)
(15/31) Installing qt5-qtdeclarative (5.15.10_git20230629-r0)
(16/31) Installing qt5-qtwayland (5.15.10_git20230714-r0)
(17/31) Installing mesa-gbm (24.0.9-r1)
(18/31) Installing mesa-egl (24.0.9-r1)
(19/31) Installing libevdev (1.13.1-r0)
(20/31) Installing mtdev (1.1.6-r3)
(21/31) Installing eudev-libs (3.2.14-r2)
(22/31) Installing libinput-libs (1.25.0-r0)
(23/31) Installing xcb-util-wm (0.4.2-r0)
(24/31) Installing xcb-util (0.4.1-r3)
(25/31) Installing xcb-util-image (0.4.1-r0)
(26/31) Installing xcb-util-keysyms (0.4.1-r0)
(27/31) Installing xcb-util-renderutil (0.3.10-r0)
(28/31) Installing libxkbcommon-x11 (1.7.0-r0)
(29/31) Installing qt5-qtbase-x11 (5.15.10_git20230714-r2)
(30/31) Installing libraw (0.21.2-r0)
(31/31) Installing libkdcraw (24.02.2-r0)
Executing busybox-1.36.1-r29.trigger
OK: 1329 MiB in 316 packages
e11b87d593f9:/app# dcraw
Error relocating /usr/bin/dcraw: __isoc23_fscanf: symbol not found
Error relocating /usr/bin/dcraw: __isoc23_sscanf: symbol not found
Error relocating /usr/bin/dcraw: __isoc23_strtol: symbol not found

a10kiloham avatar May 14 '25 17:05 a10kiloham

The problem as mentioned by @C4illin earlier is that the dcraw is not bundled in the GraphicsMagick, pull and compile it directly in the docker container to fix it.

apk add build-base wget https://www.dechifro.org/dcraw/dcraw.c gcc -o dcraw -O4 dcraw.c -lm -DNODEPS cp dcraw /usr/local/bin

OR use https://raw.githubusercontent.com/6by9/dcraw/refs/heads/master/dcraw.c

could add a RUN command to the image creation and sort this out 👍

harishkarthiktk avatar May 21 '25 06:05 harishkarthiktk

@Kitof and others who want this: Could you test the latest :main image, anything missing?

EDIT: wait with this, it is a little broken now

C4illin avatar May 23 '25 09:05 C4illin

now it should be available on :main

C4illin avatar May 23 '25 19:05 C4illin