Commando's

ImageMagick 7 installeren op ddev project 

 Bewerk: .ddev/web-build/Dockerfile 

 # Use ImageMagick 7 instead of 6

# See: https://github.com/ddev/ddev/issues/5332

RUN apt update

RUN apt remove "*imagemagick*" --purge -y && apt autoremove --purge -y

RUN apt install -y php-pear php8.3-dev libaom-dev aom-tools cmake build-essential libltdl-dev libjpeg-dev libpng-dev libtiff-dev libgif-dev libfreetype6-dev liblcms2-dev libxml2-dev

ENV IMAGEMAGICK_DIR=/usr/local/imagemagick7

RUN mkdir -p $IMAGEMAGICK_DIR

RUN git clone https://github.com/SoftCreatR/imei $IMAGEMAGICK_DIR

RUN chmod +x $IMAGEMAGICK_DIR/imei.sh

RUN bash $IMAGEMAGICK_DIR/imei.sh

# install the Imagick PHP Extension

RUN apt-get update \

 && pecl install imagick 

 dan: .ddev/php/php.ini bewerken en toevoegen: 

 extension = imagick.so 

 

 Dan herstarten: 

 ddev restart 

 Om te controleren: 

 ddev ssh

magick -version 

 Nu kan je een custom policy maken door de originele van imagemagick 7 te kopieren: 

 cp /usr/local/etc/ImageMagick-7/policy.xml ~/.config/ImageMagick

nano ~/.config/ImageMagick/policy.xml 

 Overige ddev commando's 

 magick convert -list resource

magick identify -list policy

In ddev:

.ddev/.webimageBuild/policy.xml

.ddev/web-build/policy.xml

dan ddev restart

ddev ssh

convert identify -list policy

convert identify -list resource

# ------- demo commandos ----------

ddev exec magick /var/www/html/web/modules/custom/dam_media_adjustments/assets/demo-input-2.png -resize 650x650 /var/www/html/tmp/demo-output.png

magick convert -resample 72x72 -units PixelsPerInch -strip -resize 460x /data/sites/web/damagfaradiologysolutionscom/test/test-5000x4681.jpg -density 72 /data/sites/web/damagfaradiologysolutionscom/test/test-result-1.png

magick convert -resample 72x72 -units PixelsPerInch -strip -resize 460x /data/sites/web/damagfaradiologysolutionscom/test/AGFA-RADIOLOGY_conceptbeeld_X-Ray.jpg -density 72 /data/sites/web/damagfaradiologysolutionscom/test/test-result-2.png

magick convert /data/sites/web/damagfaradiologysolutionscom/production/private/assets/graphic_files/AGFA-RADIOLOGY_conceptbeeld_X-Ray.psd /data/sites/web/damagfaradiologysolutionscom/production/private/psd_previews/media_321/AGFA-RADIOLOGY_conceptbeeld_X-Ray.jpg/AGFA-RADIOLOGY_conceptbeeld_X-Ray.jpg

magick convert -units PixelsPerInch /data/sites/web/damagfaradiologysolutionscom/production/private/assets/graphic_files/AGFA-RADIOLOGY_conceptbeeld_X-Ray.psd -density 72 /data/sites/web/damagfaradiologysolutionscom/production/private/psd_previews/media_321/AGFA-RADIOLOGY_conceptbeeld_X-Ray-72-dpi.png

magick convert -units PixelsPerInch /data/sites/web/damagfaradiologysolutionscom/production/private/assets/graphic_files/AGFA-RADIOLOGY_conceptbeeld_X-Ray.psd[0] -density 72 /data/sites/web/damagfaradiologysolutionscom/production/private/psd_previews/media_321/AGFA-RADIOLOGY_conceptbeeld_X-Ray-72-dpi.png