Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker image: Please install dcraw #354

Open
jbglaw opened this issue Oct 31, 2023 · 5 comments
Open

Docker image: Please install dcraw #354

jbglaw opened this issue Oct 31, 2023 · 5 comments
Labels
bug Existing bug

Comments

@jbglaw
Copy link

jbglaw commented Oct 31, 2023

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 jbglaw added the bug Existing bug label Oct 31, 2023
@rprieto
Copy link
Member

rprieto commented Nov 30, 2023

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.

@usmanatron
Copy link

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

@usmanatron
Copy link

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 :-)

@rprieto
Copy link
Member

rprieto commented Jan 4, 2024

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.

@mgwerder
Copy link

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"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Existing bug
Projects
None yet
Development

No branches or pull requests

4 participants