imagick

Generate SVG Image using svg raw data in imagick php

匿名 (未验证) 提交于 2019-12-03 08:46:08
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to create svg image using svg raw data which i am getting from fabric js. I have used below code to generate the svg using svg raw data but its not working properly. public function generate_svg($raw_svg='',$prefix='',$folder_name='card_image') { $file_name = ''; if($raw_svg!='') { try{ $file_name = uniqid($prefix).".svg"; $image = new \Imagick(); $image->readImageBlob($raw_svg); $image->setImageFormat("svg"); $image->writeImage($folder_name.$file_name); } catch (ImagickException $ex) { echo $ex->getMessage(); } } return $file

Imagick. Changing a color to be transparent

穿精又带淫゛_ 提交于 2019-12-03 03:48:21
I would like to change the black border of this image : http://dev.loungeup.net/im/ to transparent with Imagick in PHP. The result image should have the gray border visible, the image inside the gray border visible, and everything outside the gray border (today in black) should be transparent and let the underlying content (in HTML page for example) visible. I have been through the documentation several times and tried several solutions but did not figure out how to achieve it. Any help is appreciated. Thanks Here's one method you could use which is similar to Photoshop's magic wand tool:

set density parameter for imagick with php

匿名 (未验证) 提交于 2019-12-03 03:10:03
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want to convert a pdf page to a png image with Imagick. I tried with PHP, but the image quality was very low. When I tried with command line, the result was perfect. PHP code $im = new imagick( __DIR__ . DIRECTORY_SEPARATOR.$PDFName.'['.$i.']' ); $params = $im->identifyImage(); $width = $params['geometry']['width']*1; $height = $params['geometry']['height']*1; $im->setResolution(400,400); $im->resizeImage($width ,$height, imagick::FILTER_SINC, 1, true); $im->writeImage(__DIR__ . DIRECTORY_SEPARATOR.'pdf_pages\\'.$i.'.png'); $im->clear();

Can't install Imagick for PHP on Debian

匿名 (未验证) 提交于 2019-12-03 02:56:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Pulling my hair out. PHP built from source, everything working. Now need to install imagick and can't get it installed. I am running Debian on kernel 3.7.1 with PHP 5.3.20 (the last version my app supports, cannot go to PHP 5.4). pecl install imagick ... checking ImageMagick MagickWand API configuration program... found in /usr/bin/Wand-config checking if ImageMagick version is at least 6.2.4... configure: error: no. You need at least Imagemagick version 6.2.4 to use Imagick. ERROR: `/tmp/pear/temp/imagick/configure --with-imagick' failed

php imagick convert PNG to jpg

匿名 (未验证) 提交于 2019-12-03 01:58:03
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: $image = "[...]" ; //binary string containing PNG image $file = fopen ( 'image.tmp' , 'wb' ); fputs ( $file , $image ); fclose ( $file ); $image = new Imagick ( 'PNG:image.tmp' ); $image -> thumbnailImage ( $width , $height ); $image -> setImageFormat ( 'jpg' ); $image -> setCompressionQuality ( 97 ); $image -> writeImage ( 'image.jpg' ); The above doesn't work and gives me a black image for this image. When doing instead [...] $image -> setImageFormat ( 'png' ); $image -> setCompressionQuality ( 97 ); $image -> writeImage ( 'image

How to install Imagick/imagemagick on windows 7

匿名 (未验证) 提交于 2019-12-03 01:33:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 选择语言 中文(简体) 日语 英语 中文(繁体) 由 翻译 强力驱动 问题: How to install image magic in Windows 7. I followed these instruction To install IMagick on Windows XP (php 5.2.x) download and install ImageMagick-6.5.8-7 Q16-windows-dll.exe http://www.imagemagick.org/download/binaries/ ImageMagick-6.5.8-7-Q16-windows-dll.exe download php_imagick_dyn-Q16.dll from: http://valokuva.org/outside-blog-content/ imagick-windows-builds/080709/ copy dll to [PHP]/extension dir and rename it to php_imagick.dll You have to edit your php.ini file and add new extension extension = php

Detect EXIF Orientation and Rotate Image using ImageMagick

匿名 (未验证) 提交于 2019-12-03 01:11:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: Canon DSLRs appear to save photos in landscape orientation and uses exif::orientation to do the rotation. Question: How can imagemagick be used to re-save the image into the intended orientation using the exif orientation data such that it no longer requires the exif data to display in the correct orientation? 回答1: You could use the auto-orient option of convert to do this. convert your - image . jpg - auto - orient output . jpg 回答2: The PHP Imagick way would be to test the image orientation and rotate/flip the image accordingly:

Laravel 5.2: Class Imagick not found

匿名 (未验证) 提交于 2019-12-03 00:56:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: We are converting PDF pages to multiple single images. We found a code snippet in stackoverflow and converted it to a service class. We have Imagick installed and it shows up in phpinfo() as well. However, in our laravel application, version 5.2, we are getting following error. ReflectionException in Container.php line 798: Class Imagick does not exist We tested our code outside laravel environment and it's working like a charm. No such error is thrown. We also ran following command to check Imagick php -i | grep -i imagick and this is the

Imagemagick thumbnail generation with php - using -crop

左心房为你撑大大i 提交于 2019-12-02 22:03:19
问题 Long ago I created a small library for resizing images using imagemagick through system(...) because I did not feel that the build-in imagemagick functions for PHP were sufficient. However, recently I had to port this to a symfony project and I chose to use sfThumbnailPlugin (if I remember correctly). This unfortunately didn't include the crop functionality - i.e. to specify a desired size, e.g. 300x300 px and have the thumbnail cropped so that it fit. I chose to implement this functionality

Linux下php安装imagick

本小妞迷上赌 提交于 2019-12-02 21:29:48
说明: php安装目录:/usr/local/php5 php.ini配置文件路径:/usr/local/php5/etc/php.ini Nginx安装目录:/usr/local/nginx Nginx网站根目录:/usr/local/nginx/html 1、安装编译工具 yum install wget make gcc gcc-c++ gtk+-devel zlib-devel openssl openssl-devel pcre-devel kernel keyutils patch perl 2、安装ImageMagick 系统运维 www.osyunwei.com 温馨提醒:qihang01原创内容版权所有,转载请注明出处及原文链接 cd /usr/local/src #进入软件包存放目录 wget http://www.imagemagick.org/download/ImageMagick.tar.gz #下载ImageMagick tar zxvf ImageMagick.tar.gz #解压 cd ImageMagick-6.7.9-3 #进入安装目录 ./configure --prefix=/usr/local/imagemagick #配置 make #编译 make install #安装 export PKG_CONFIG_PATH=/usr