thumbsup icon indicating copy to clipboard operation
thumbsup copied to clipboard

Docker image: Please install `dcraw`

Open jbglaw opened this issue 2 years ago • 5 comments

Hi!

I've got a bunch of .CR2 raw images, which generally would process properly with dcraw.

Using the Docker image (found at ghcr.io/thumbsup/thumbsup), thumbsup wouldn't work on the .CR2 images:

2023-10-31T22:39:24.361Z thumbsup:error Error processing IMG_1938.CR2 -> media/small/IMG_1938.jpg
2023-10-31T22:39:24.361Z thumbsup:error Error: Command failed: sh: dcraw: not found
2023-10-31T22:39:24.361Z thumbsup:error gm identify: "dcraw" -c -w -6 -T "/data/_raw_/IMG_1938.CR2" > "/tmp/gmzAZvrM".
2023-10-31T22:39:24.361Z thumbsup:error gm identify: Delegate failed ("dcraw" -c -w -6 -T "%i" > "undefined").
2023-10-31T22:39:24.361Z thumbsup:error gm identify: Request did not return an image.

jbglaw avatar Oct 31 '23 22:10 jbglaw

Hi! Thanks for raising this. It's a good idea. I see dcraw is available on some package managers (e.g. apt install dcraw) but not in Alpine Linux. I will look into building it from source.

rprieto avatar Nov 30 '23 22:11 rprieto

I'd like to have a go at this - fingers crossed Ill have time over the next week or so

usmanatron avatar Jan 02 '24 10:01 usmanatron

Question: What are your thoughts on moving away from alpine to something like Debian? Before spending time working out compiling, I just want to confirm that's the right way to fix this as opposed to using something which has the package already available!

Let me know what you think :-)

usmanatron avatar Jan 02 '24 11:01 usmanatron

Thanks for offering to help! Great question about Alpine / Debian. I've been wondering about making the switch. I opened a new issue to track this: #358. For now I suggest adding dcraw to the existing Alpine image with a multi-stage build.

rprieto avatar Jan 04 '24 15:01 rprieto

For all those in need of dcraw: I have a small Dockerfile adding dcraw-support. However, the dcraw support seems to ignore the color settings embedded in the file. My files look a dull when converted with the automated process of thumbsup and I did not find the cause for it so far.

Important note: The Dockerfile works but does a VERY dirty job. anyone keen into building it with a proper intermediate container is highly welcomed.

FROM ghcr.io/thumbsup/thumbsup

# install prerequisites
RUN apk add wget curl build-base gcc gawk jasper-dev libjpeg libjpeg-turbo-dev

# build iconv
RUN cd /tmp; \
    wget https://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.17.tar.gz; \
    tar -xzvf libiconv-*.tar.gz ;\
    cd libiconv* ; \
    ./configure ; \
RUN cd /tmp/libiconv* ; \
    make ; \
    make install ;

# build gettext
RUN cd /tmp ; \
    wget https://ftp.gnu.org/gnu/gettext/gettext-0.22.tar.xz ; \
    tar -xvf gettext-*.tar.xz ; \
    cd /tmp/gettext* ; \
    ./configure ;
RUN cd /tmp/gettext* ; \
    make ; \
    make install ;

RUN apk add lcms2-dev

# build dcraw
RUN cd /tmp ; \
    wget https://www.dechifro.org/dcraw/archive/dcraw-9.28.0.tar.gz ; \
    tar -xzvf dcraw-*.tar.gz ; \
    cd /tmp/dcraw ; \
    sed 's/-llcms2/-llcms2 -lintl/' <install >install.new && mv install.new install ; \
    chmod 755 install ;
RUN cd /tmp/dcraw ; \
    ./install ;

# delete temporary build structures
RUN rm -r /tmp/*

# add optional stuff
RUN apk add ffmpeg gifsicle imagemagick

# make sure thumbsup is run upon container start
CMD ["thumbsup"]

mgwerder avatar Jan 21 '24 09:01 mgwerder