Skip to content

Commit

Permalink
fix issue with heif and add test for it
Browse files Browse the repository at this point in the history
  • Loading branch information
dpfaffenbauer authored and brusch committed Jan 10, 2023
1 parent 487028b commit b283888
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 31 deletions.
13 changes: 13 additions & 0 deletions .github/files/test_heif.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

try {
$tmpFile = __DIR__.'/imagick-format-support-detection-'.uniqid('avif', true).'.avif';
$image = new \Imagick();
$image->newImage(1, 1, new \ImagickPixel('red'));
$image->writeImage('avif'.':'.$tmpFile);
unlink($tmpFile);

return 0;
} catch (\Exception $e) {
return 1;
}
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ jobs:
fi
docker run --rm pimcore-image composer create-project pimcore/skeleton:^10.0 pimcore --no-scripts
docker run -v "$(pwd)/.github/files":/var/www/html --rm pimcore-image php test_heif.php
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
Expand Down
61 changes: 30 additions & 31 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,57 +27,54 @@ RUN set -eux; \
docker-php-ext-install pcntl intl mbstring mysqli bcmath bz2 soap xsl pdo pdo_mysql fileinfo exif zip opcache sockets; \
\
git clone https://aomedia.googlesource.com/aom; \
mkdir aom-build; \
cmake -S aom/ -B aom-build/; \
cd aom-build; \
make --jobs=$(nproc); \
make install; \
ldconfig /usr/local/lib; \
cd ..; \
rm -Rf aom; \
rm -Rf aom-build; \
mkdir aom-build; \
cmake -S aom/ -B aom-build/; \
cd aom-build; \
make --jobs=$(nproc); \
make install; \
cd ..; \
rm -Rf aom; \
rm -Rf aom-build; \
\
git clone https://github.com/AOMediaCodec/libavif.git; \
mkdir libavif-build; \
cmake -S libavif/ -B libavif-build/; \
cd libavif-build; \
make --jobs=$(nproc); \
make install; \
ldconfig /usr/local/lib; \
cd ..; \
rm -Rf libavif; \
rm -Rf libavif-build; \
mkdir libavif-build; \
cmake -S libavif/ -B libavif-build/; \
cd libavif-build; \
make --jobs=$(nproc); \
make V=0; \
make install; \
cd ..; \
rm -Rf libavif; \
rm -Rf libavif-build; \
\
git clone https://github.com/strukturag/libheif.git; \
cd libheif; \
./autogen.sh; \
./configure; \
make --jobs=$(nproc); \
make install; \
ldconfig /usr/local/lib; \
cd ..; \
rm -Rf libheif; \
cd libheif; \
./autogen.sh; \
./configure; \
make V=0; \
make --jobs=$(nproc); \
make install; \
cd ..; \
rm -Rf libheif; \
\
wget https://imagemagick.org/archive/ImageMagick.tar.gz; \
tar -xvf ImageMagick.tar.gz; \
cd ImageMagick-7.*; \
./configure; \
make --jobs=$(nproc); \
make V=0; \
make install; \
ldconfig /usr/local/lib; \
cd ..; \
rm -rf ImageMagick*; \
\
docker-php-ext-configure gd -enable-gd --with-freetype --with-jpeg --with-webp; \
docker-php-ext-install gd; \
pecl install -f xmlrpc; \
pecl install imagick; \
pecl install apcu; \
pecl install redis; \
pecl install -f xmlrpc imagick apcu redis; \
docker-php-ext-enable redis imagick apcu; \
docker-php-ext-configure imap --with-kerberos --with-imap-ssl; \
docker-php-ext-install imap; \
docker-php-ext-enable imap; \
ldconfig /usr/local/lib; \
\
cd /tmp; \
\
Expand All @@ -90,6 +87,8 @@ RUN set -eux; \
apt-get clean; \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* ~/.composer || true

RUN ldconfig /usr/local/lib; sync;

RUN echo "upload_max_filesize = 100M" >> /usr/local/etc/php/conf.d/20-pimcore.ini; \
echo "memory_limit = 256M" >> /usr/local/etc/php/conf.d/20-pimcore.ini; \
echo "post_max_size = 100M" >> /usr/local/etc/php/conf.d/20-pimcore.ini
Expand Down

0 comments on commit b283888

Please sign in to comment.