imagick

Imagick: PNG support available in command line, but not available in PHP

。_饼干妹妹 提交于 2019-12-13 18:09:55
问题 I found that I did not have PNG support in my Imagick installation, so I installed libpng . Now I can see that PNG format is supported when I run a command convert -list format And conversion from PNG to JPG works fine from command line: convert a.png b.jpg But when I try to read a PNG file in PHP: $src = new \Imagick(); $src->readImageBlob( file_get_contents($file) ); // reading PNG format -it gives me Error 500 ("...no decode delegate for this image format") Also when I run phpinfo() - I

Imagemagick set interline spacing?

…衆ロ難τιáo~ 提交于 2019-12-13 16:56:21
问题 In application using imagemagick the design is specified like this: $draw->setFillColor(new ImagickPixel("#FFFFFF")); $draw->setstrokecolor(new ImagickPixel("#000000")); $draw->setstrokewidth(1); $draw->setFontSize(18); $draw->setfontweight(100); $draw->setFont("fonts/Impact.ttf"); I'd like to set interline Spacing in a similair fashion, but all samples are displayed like this: convert -density 72 -pointsize 12 -interline-spacing 12 -font Arial \ How can I access the interline-spacing command

svg to png is not working in php

前提是你 提交于 2019-12-13 08:47:43
问题 I am using the imagick to convert svg to png. But my svg contain embedded images in it. so while converting it to png does not render the embedded image. $image = new \Imagick(); try{ $file_name = uniqid($prefix).".jpeg"; $image->readImageBlob($raw_svg); $image->setImageFormat("png24"); $image->writeImage("$folder_name/".$file_name); } catch (ImagickException $ex) { echo $ex->getMessage(); } SVG Data <?xml version="1.0" encoding="UTF-8" standalone="no" ?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG

where can I find “imagick.so” for for ImageMagick 6.9.0.0 x86_64?

只谈情不闲聊 提交于 2019-12-13 05:29:40
问题 I am not a Linux User. I recently install ImageMagick on a CentOS via this tutorial: https://www.vultr.com/docs/install-imagemagick-on-centos-6 Seems everything installed normally... But After install,It seems I do not have "imagick.so" in my server... I got this error with ' php -m | grep imagick ' command: PHP warning: PHP Startup: Unable to load dynamic liberary '/usr/local/php54/lib/php/extentions/no-debug-non-zts-20100525/imagick.so: cannot open shared object file: No such file or

Image from RGB To Cmyk in php

北慕城南 提交于 2019-12-13 05:12:14
问题 I've some problem with php and imagick, i want to convert some image from rgb system to cmyk, but i've only black/or non background nothing else. $icc_cmyk = file_get_contents('USWebUncoated.icc'); $img->profileImage('icc', $icc_cmyk); $img->setImageColorspace(12); if ($php_vs < 5.3) { //ADJUST GAMMA BY 20% for 5.2.x $img->levelImage(0, 2.0, $range['quantumRangeString']); } else { //php 5.3 hack FOR INVERTED COLORS $img->negateImage(false, Imagick::CHANNEL_ALL); } $img->stripImage(); //$img-

I cant save some facebook images to my server as it does not understand the file

∥☆過路亽.° 提交于 2019-12-13 05:11:13
问题 I am using the facebook graph api and it was working well until I realised that some of the jpg files have a query string at the end that is making them unusable. e.g. https://scontent.xx.fbcdn.net/hphotos-xaf1/v/t1.0-9/487872_451835128174833_1613257199_n.jpg?oh=621bed79f5436e81c3e219c86db8f0d9&oe=560F3D0D I have tried stripping off everything after .jpg in the hope that it would still load the image but unfortunately it doesnt. In the following code take the $facebook_image_url to be the one

Imagick Equivalent Of This Imagemagick Command?

房东的猫 提交于 2019-12-13 04:26:59
问题 I'm trying to create a vignette effect, and I can get desired result through command line. But when I try it with Imagick, I'm not getting the desired result convert i.jpg ( -size 150x150 radial-gradient:black-white -gravity center -crop 100x100+0+0 +repage ) -compose multiply -flatten o.jpg I tried the following Imagick commands $gra = new Imagick(); $gra->newPseudoImage(150, 150, "radial-gradient:black-white"); $gra->cropThumbnailImage(100, 100); $gra->setImagePage(100, 100, 0, 0); $img =

How to draw a long text to a image without wrapping it (using Imagick php)

孤街醉人 提交于 2019-12-13 04:17:40
问题 I want to draw text in a image, using Imagick and PHP (support by Hostgator). I have problem when the text is very long, i don't want to wrapping (new lines), I want to scale width of the text (height is a constant). Here is a Demo that I want. Please tell me the solution. My PHP code: if(isset($_POST["value1"])){ $image = new Imagick('background.jpg'); $text = $_POST["value1"]; $draw = new ImagickDraw(); $draw->setFont('Arial.ttf'); $draw->setFontSize(25); $draw->setGravity(Imagick::GRAVITY

Convert pdf to Tiff with same quality

强颜欢笑 提交于 2019-12-13 03:34:45
问题 We are using following shell script to convert pdf attachment in tiff but having some issue with quality, So can you please check below shell script and let us know anything where we can improve quality as well as compress file size too as much as possible while conversation. shell_exec('/usr/bin/gs -q -sDEVICE=tiffg4 -r204x392 -dBATCH -dPDFFitPage -dNOPAUSE -sOutputFile=america_out7.tif america_test.pdf'); We have tried following command and seems quality is better but when we are going to

PHP Imagick don't use custom font > convert does

孤街浪徒 提交于 2019-12-13 03:18:15
问题 It's driving me insane.. Just searched for hours to find a solution. But nothing really found. So hopefully anyone can help me. I'm trying to create an customized image on the fly. I use this to create the images: https://github.com/Treinetic/ImageArtist Everything works fine except the font. This is the snippet from the class: $im = new \Imagick(); $background = new \ImagickPixel('none'); $im->setBackgroundColor($background); $im->setFont($font->getPath()); $im->setPointSize($writer->getSize