Skip to content

Commit

Permalink
Merge pull request #6 from dooman87/feature/avif-support
Browse files Browse the repository at this point in the history
Feature/avif support
  • Loading branch information
dooman87 authored Aug 9, 2020
2 parents b0262e5 + 128276a commit e12bcbd
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 15 deletions.
25 changes: 17 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,30 @@ services:
- docker

before_install:
- docker build -t im .
- docker build -t im-fedora27 -f Dockerfile.fedora27 .
- docker build -t im-stretch -f Dockerfile.stretch .
- docker build -t im-buster -f Dockerfile.buster .

script:
- docker run --rm -v $(pwd):/imgs im -resize 500 /imgs/test.jpg /imgs/test-resize.jpg
- docker run --rm -v $(pwd):/imgs im -resize 500 /imgs/test.jpg webp:/imgs/test-jpg.webp
- docker run --rm -v $(pwd):/imgs im -resize 500 /imgs/test.jpg jxr:/imgs/test-jpg.jxr
- docker run --rm -v $(pwd):/imgs im -resize 100 /imgs/test.png /imgs/test-resize.png
- docker run --rm -v $(pwd):/imgs im -resize 100 /imgs/test.png webp:/imgs/test-png.webp
- docker run --rm -v $(pwd):/imgs im -resize 100 /imgs/test.png jxr:/imgs/test-png.jxr
- docker run --rm -v $(pwd):/imgs im /imgs/test.pdf /imgs/test-pdf.png
- docker run --rm -v $(pwd):/imgs im-fedora27 -resize 500 /imgs/test.jpg /imgs/test-resize.jpg
- docker run --rm -v $(pwd):/imgs im-fedora27 -resize 500 /imgs/test.jpg webp:/imgs/test-jpg.webp
- docker run --rm -v $(pwd):/imgs im-fedora27 -resize 500 /imgs/test.jpg jxr:/imgs/test-jpg.jxr
- docker run --rm -v $(pwd):/imgs im-fedora27 -resize 100 /imgs/test.png /imgs/test-resize.png
- docker run --rm -v $(pwd):/imgs im-fedora27 -resize 100 /imgs/test.png webp:/imgs/test-png.webp
- docker run --rm -v $(pwd):/imgs im-fedora27 -resize 100 /imgs/test.png jxr:/imgs/test-png.jxr
- docker run --rm -v $(pwd):/imgs im-fedora27 /imgs/test.pdf /imgs/test-pdf.png
- ls -l
- docker run --rm -v $(pwd):/imgs im-stretch -resize 500 /imgs/test.jpg /imgs/test-resize.jpg
- docker run --rm -v $(pwd):/imgs im-stretch -resize 500 /imgs/test.jpg webp:/imgs/test-jpg.webp
- docker run --rm -v $(pwd):/imgs im-stretch -resize 100 /imgs/test.png /imgs/test-resize.png
- docker run --rm -v $(pwd):/imgs im-stretch -resize 100 /imgs/test.png webp:/imgs/test-png.webp
- docker run --rm -v $(pwd):/imgs im-stretch /imgs/test.pdf /imgs/test-pdf.png
- ls -l
- docker run --rm -v $(pwd):/imgs im-buster -resize 500 /imgs/test.jpg /imgs/test-resize.jpg
- docker run --rm -v $(pwd):/imgs im-buster -resize 500 /imgs/test.jpg webp:/imgs/test-jpg.webp
- docker run --rm -v $(pwd):/imgs im-buster -resize 500 /imgs/test.jpg avif:/imgs/test-jpg.avif
- docker run --rm -v $(pwd):/imgs im-buster -resize 100 /imgs/test.png /imgs/test-resize.png
- docker run --rm -v $(pwd):/imgs im-buster -resize 100 /imgs/test.png webp:/imgs/test-png.webp
- docker run --rm -v $(pwd):/imgs im-buster -resize 100 /imgs/test.png avif:/imgs/test-png.avif
- docker run --rm -v $(pwd):/imgs im-buster /imgs/test.pdf /imgs/test-pdf.png
- ls -l
41 changes: 41 additions & 0 deletions Dockerfile.buster
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
FROM debian:buster-slim

ARG IM_VERSION=7.0.10-25
ARG LIB_HEIF_VERSION=1.7.0
ARG LIB_AOM_VERSION=2.0.0

RUN apt-get -y update && \
apt-get -y upgrade && \
apt-get install -y git make gcc pkg-config autoconf curl g++ \
# libaom
yasm cmake \
# libheif
libde265-0 libde265-dev libjpeg62-turbo libjpeg62-turbo-dev x265 libx265-dev libtool \
# IM
libpng16-16 libpng-dev libjpeg62-turbo libjpeg62-turbo-dev libwebp6 libwebp-dev libgomp1 libwebpmux3 libwebpdemux2 ghostscript && \
# Building libaom
git clone https://aomedia.googlesource.com/aom && \
cd aom && git checkout v${LIB_AOM_VERSION} && cd .. && \
mkdir build_aom && \
cd build_aom && \
cmake ../aom/ -DENABLE_TESTS=0 -DBUILD_SHARED_LIBS=1 && make && make install && \
ldconfig /usr/local/lib && \
cd .. && \
rm -rf aom && \
rm -rf build_aom && \
# Building libheif
curl -L https://github.com/strukturag/libheif/releases/download/v${LIB_HEIF_VERSION}/libheif-${LIB_HEIF_VERSION}.tar.gz -o libheif.tar.gz && \
tar -xzvf libheif.tar.gz && cd libheif-${LIB_HEIF_VERSION}/ && ./autogen.sh && ./configure && make && make install && cd .. && \
ldconfig /usr/local/lib && \
rm -rf libheif-${LIB_HEIF_VERSION} && rm libheif.tar.gz && \
# Building ImageMagick
git clone https://github.com/ImageMagick/ImageMagick.git && \
cd ImageMagick && git checkout ${IM_VERSION} && \
./configure --without-magick-plus-plus --disable-docs --disable-static && \
make && make install && \
ldconfig /usr/local/lib && \
apt-get remove --autoremove --purge -y gcc make cmake curl g++ yasm git autoconf pkg-config libpng-dev libjpeg62-turbo-dev libwebp-dev libde265-dev libx265-dev && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /ImageMagick

ENTRYPOINT ["convert"]
4 changes: 2 additions & 2 deletions Dockerfile → Dockerfile.fedora27
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ARG IM_VERSION=7.0.10-23

FROM fedora:27

ARG IM_VERSION=7.0.10-25

RUN dnf -y install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm && \
yum -y update

Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.stretch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ARG IM_VERSION=7.0.10-23

FROM debian:stretch-slim

ARG IM_VERSION=7.0.10-25

RUN apt-get -y update && \
apt-get -y upgrade && \
apt-get -y install git make gcc pkg-config autoconf && \
Expand Down
16 changes: 13 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@

Delivers the latest version of the [ImageMagick](https://github.com/ImageMagick/ImageMagick) 7 to your environment in Docker container.

The purpose of that image is to be able to run the latest version of ImageMagick in stable
Linux environment with supporting modern web formats.

## Usage

By default container will run convert command
By default, container will run convert command

```
$ docker run -v /your/images:/imgs dpokidov/imagemagick /imgs/sample.png -resize 100x100 /imgs/resized-sample.png
Expand All @@ -24,6 +27,13 @@ $ docker run --entrypoint=identify -v /your/images:/imgs dpokidov/imagemagick /i

## Base images

There are two base images: Fedora:27 and Debian Stretch. By default Fedora is used. To use debian use
:stretch tag instead.
There are three base images: Fedora:27, Debian Buster (stable) and Debian Stretch (oldstable). By default Debian Buster is used.
Use tags to switch between base images. Not all images support the same features. Below is a table of known
formats supported by different base images:

| Base Image | Jpeg | PNG | JpegXR | WebP | AVIF | PDF |
| ---------- | :---: | :---: | :------: | :----: | :----: | :---: |
| fedora27 | X | X | X | X | | X |
| stretch | X | X | | X | | X |
| buster | X | X | | X | X | X |

0 comments on commit e12bcbd

Please sign in to comment.