Skip to content

Commit b283888

Browse files
dpfaffenbauerbrusch
authored andcommitted
fix issue with heif and add test for it
1 parent 487028b commit b283888

File tree

3 files changed

+44
-31
lines changed

3 files changed

+44
-31
lines changed

.github/files/test_heif.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
try {
4+
$tmpFile = __DIR__.'/imagick-format-support-detection-'.uniqid('avif', true).'.avif';
5+
$image = new \Imagick();
6+
$image->newImage(1, 1, new \ImagickPixel('red'));
7+
$image->writeImage('avif'.':'.$tmpFile);
8+
unlink($tmpFile);
9+
10+
return 0;
11+
} catch (\Exception $e) {
12+
return 1;
13+
}

.github/workflows/test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ jobs:
7070
fi
7171
7272
docker run --rm pimcore-image composer create-project pimcore/skeleton:^10.0 pimcore --no-scripts
73+
docker run -v "$(pwd)/.github/files":/var/www/html --rm pimcore-image php test_heif.php
7374
- name: Run Trivy vulnerability scanner
7475
uses: aquasecurity/trivy-action@master
7576
with:

Dockerfile

Lines changed: 30 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -27,57 +27,54 @@ RUN set -eux; \
2727
docker-php-ext-install pcntl intl mbstring mysqli bcmath bz2 soap xsl pdo pdo_mysql fileinfo exif zip opcache sockets; \
2828
\
2929
git clone https://aomedia.googlesource.com/aom; \
30-
mkdir aom-build; \
31-
cmake -S aom/ -B aom-build/; \
32-
cd aom-build; \
33-
make --jobs=$(nproc); \
34-
make install; \
35-
ldconfig /usr/local/lib; \
36-
cd ..; \
37-
rm -Rf aom; \
38-
rm -Rf aom-build; \
30+
mkdir aom-build; \
31+
cmake -S aom/ -B aom-build/; \
32+
cd aom-build; \
33+
make --jobs=$(nproc); \
34+
make install; \
35+
cd ..; \
36+
rm -Rf aom; \
37+
rm -Rf aom-build; \
3938
\
4039
git clone https://github.com/AOMediaCodec/libavif.git; \
41-
mkdir libavif-build; \
42-
cmake -S libavif/ -B libavif-build/; \
43-
cd libavif-build; \
44-
make --jobs=$(nproc); \
45-
make install; \
46-
ldconfig /usr/local/lib; \
47-
cd ..; \
48-
rm -Rf libavif; \
49-
rm -Rf libavif-build; \
40+
mkdir libavif-build; \
41+
cmake -S libavif/ -B libavif-build/; \
42+
cd libavif-build; \
43+
make --jobs=$(nproc); \
44+
make V=0; \
45+
make install; \
46+
cd ..; \
47+
rm -Rf libavif; \
48+
rm -Rf libavif-build; \
5049
\
5150
git clone https://github.com/strukturag/libheif.git; \
52-
cd libheif; \
53-
./autogen.sh; \
54-
./configure; \
55-
make --jobs=$(nproc); \
56-
make install; \
57-
ldconfig /usr/local/lib; \
58-
cd ..; \
59-
rm -Rf libheif; \
51+
cd libheif; \
52+
./autogen.sh; \
53+
./configure; \
54+
make V=0; \
55+
make --jobs=$(nproc); \
56+
make install; \
57+
cd ..; \
58+
rm -Rf libheif; \
6059
\
6160
wget https://imagemagick.org/archive/ImageMagick.tar.gz; \
6261
tar -xvf ImageMagick.tar.gz; \
6362
cd ImageMagick-7.*; \
6463
./configure; \
6564
make --jobs=$(nproc); \
65+
make V=0; \
6666
make install; \
67-
ldconfig /usr/local/lib; \
6867
cd ..; \
6968
rm -rf ImageMagick*; \
7069
\
7170
docker-php-ext-configure gd -enable-gd --with-freetype --with-jpeg --with-webp; \
7271
docker-php-ext-install gd; \
73-
pecl install -f xmlrpc; \
74-
pecl install imagick; \
75-
pecl install apcu; \
76-
pecl install redis; \
72+
pecl install -f xmlrpc imagick apcu redis; \
7773
docker-php-ext-enable redis imagick apcu; \
7874
docker-php-ext-configure imap --with-kerberos --with-imap-ssl; \
7975
docker-php-ext-install imap; \
8076
docker-php-ext-enable imap; \
77+
ldconfig /usr/local/lib; \
8178
\
8279
cd /tmp; \
8380
\
@@ -90,6 +87,8 @@ RUN set -eux; \
9087
apt-get clean; \
9188
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* ~/.composer || true
9289

90+
RUN ldconfig /usr/local/lib; sync;
91+
9392
RUN echo "upload_max_filesize = 100M" >> /usr/local/etc/php/conf.d/20-pimcore.ini; \
9493
echo "memory_limit = 256M" >> /usr/local/etc/php/conf.d/20-pimcore.ini; \
9594
echo "post_max_size = 100M" >> /usr/local/etc/php/conf.d/20-pimcore.ini

0 commit comments

Comments
 (0)