convert HEIC/HEIF image file to jpeg by libheif & GD & php - end0tknr's kipple - web写経開発
先程の上記entry の関連です。
GD + libheif で、heic/heif->jpeg 変換できるのであれば、 imagemagick でも実施しようとしました。
が、imagemagick では動作せず、今回は諦めました。 (今後、imagemagickのverionがあがれば、できるのかもしれません)
install ImageMagick ImageMagick-devel
$ sudo su - # yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm # ARCH=$( /bin/arch ) # subscription-manager repos --enable "codeready-builder-for-rhel-8-${ARCH}-rpms" Repository 'codeready-builder-for-rhel-8-x86_64-rpms' is enabled for this system. # yum install ImageMagick ImageMagick-devel
install php-pear & imagick
# yum install php-pear # pecl install imagick : Build process completed successfully Installing '/usr/lib64/php/modules/imagick.so' Installing '/usr/include/php/ext/imagick/php_imagick_shared.h' install ok: channel://pecl.php.net/imagick-3.7.0 configuration option "php_ini" is not set to php.ini location You should add "extension=imagick.so" to php.ini $ sudo vi /etc/php.ini extension=imagick.so ##<--ADD $ php -r 'phpinfo();' | grep imagick imagick imagick module => enabled imagick module version => 3.7.0 imagick classes => Imagick, ImagickDraw, ImagickPixel, ImagickPixelIterator, ImagickKernel imagick.allow_zero_dimension_images => 0 => 0 imagick.locale_fix => 0 => 0 imagick.progress_monitor => 0 => 0 imagick.set_single_thread => 1 => 1 imagick.shutdown_sleep_count => 10 => 10 imagick.skip_version_check => 0 => 0
imagemagick では、heic/heif を認識せず...
imagemagick に付属する identify や convert コマンドで 試してみました。
## identifyで HEIFやHIECが表示されず... $ /usr/bin/identify -list format | grep -i HEIF ## convert でも、jpeg に変換できず... $ /usr/bin/convert IMG_0829.HEIC IMG_0829.JPG convert: no decode delegate for this image format `HEIC' @ error/constitute.c/ReadImage/566. convert: no images defined `IMG_0829.JPG' @ error/convert.c/ConvertImageCommand/3226.