File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ FROM debian:buster AS builder
2+
3+ ENV DEBIAN_FRONTEND="noninteractive"
4+
5+ # Enable deb-src repos so we can retrieve the packages used to build libopenjp2:
6+ RUN sed -i -e '/^deb/p; s/^deb /deb-src /' /etc/apt/sources.list
7+
8+ RUN apt-get update -qqy && apt-get dist-upgrade -qqy && apt-get install -qqy quilt devscripts && apt-get build-dep -qy libopenjp2-tools
9+
10+ RUN adduser --system --group builder
11+ RUN install -d -o builder -g builder /build
12+
13+ USER builder
14+
15+ WORKDIR /build
16+
17+ RUN apt-get source openjpeg2
18+
19+ WORKDIR /build/openjpeg2-2.3.0
20+ ENV QUILT_PATCHES=debian/patches
21+
22+ # Add the patch from https://github.com/uclouvain/openjpeg/issues/1207
23+ COPY handle_colorspace_conflicts.patch /build/
24+
25+ # Apply the patch to the local source directory
26+ RUN quilt import /build/handle_colorspace_conflicts.patch
27+ RUN quilt push -a -v
28+
29+ # Build all of the openjpeg2 packages
30+ RUN debuild -uc -us
31+
132FROM debian:buster
233
334EXPOSE 8182
435
536VOLUME /imageroot
637
7- # Update packages and install tools
838RUN apt-get update -qy && apt-get dist-upgrade -qy && \
9- apt-get install -qy --no-install-recommends curl imagemagick libopenjp2-tools ffmpeg gettext unzip default-jre-headless && \
39+ apt-get install -qy --no-install-recommends curl imagemagick ffmpeg gettext unzip default-jre-headless && \
1040 apt-get -qqy autoremove && apt-get -qqy autoclean
1141
42+ # Install the patched openjpeg2 tools
43+ COPY --from=builder /build/*.deb /tmp/
44+ RUN dpkg -i /tmp/libopenjp2-*.deb /tmp/libopenjp2-tools-*.deb
45+
1246# Run non privileged
1347RUN adduser --system cantaloupe
1448
Original file line number Diff line number Diff line change 1+ --- a/src/bin/common/color.c 2019-08-08 00:45:01.903651387 +0200
2+ +++ b/src/bin/common/color.c 2019-08-08 00:39:24.442674016 +0200
3+ @@ -488,6 +488,10 @@
4+ if (out_space == cmsSigRgbData) { /* enumCS 16 */
5+ unsigned int i, nr_comp = image->numcomps;
6+
7+ + if (nr_comp < 3) { /* GRAY or GRAYA, not RGB or RGBA */
8+ + cmsCloseProfile(in_prof);
9+ + return;
10+ + }
11+ if (nr_comp > 4) {
12+ nr_comp = 4;
13+ }
You can’t perform that action at this time.
0 commit comments