imagick

IMagicExtension :Unable to read image from the filehandle

丶灬走出姿态 提交于 2019-12-02 20:55:59
问题 I have installed PHP 5.5.15 Apache 2.4.10 ImageMagick-6.7.7-5-Q16-windows-dll php_imagick-3.2.0RC1-5.5-ts-vc11-x86 Imagick extension has installed correctly. but when i run the following code $handle = fopen($url,"rb"); $img = new Imagick(); $img->readImageFile($handle); Fatal error: Uncaught exception 'ImagickException' with message 'Unable to read image from the filehandle' Thanks in advance 来源: https://stackoverflow.com/questions/33543238/imagicextension-unable-to-read-image-from-the

How to detect position of shape in image PHP [closed]

删除回忆录丶 提交于 2019-12-02 20:30:00
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 4 years ago . I have image with white background and in that image i have some kind of shape - part of cloth. I need to find most left, up, right and bottom pixel. What is the most efficient way to do that? 回答1: You can use the trimImage function to trim the image, and then look at the geometry

How to detect position of shape in image PHP [closed]

岁酱吖の 提交于 2019-12-02 07:30:19
I have image with white background and in that image i have some kind of shape - part of cloth. I need to find most left, up, right and bottom pixel. What is the most efficient way to do that? You can use the trimImage function to trim the image, and then look at the geometry and page info to find how the bounding box of the image that was left after trimming. $base = new Imagick(realpath('./trim.png')); $base->trimImage(0); $geometry = $base->getImageGeometry(); $pageInfo = $base->getImagePage(); printf ( "Width %d Height %d\n", $geometry['width'], $geometry['height'] ); printf( "OffsetX: %d

php Imagick::levelImage usage

£可爱£侵袭症+ 提交于 2019-12-02 04:03:46
问题 I have trying hard, but can't make this method works properly. The usage format is Imagick::levelImage ( float $blackPoint , float $gamma , float $whitePoint [, int $channel = Imagick::CHANNEL_ALL ] ); I try use it like $img->levelImage (0, 1.0, 255); and $img->levelImage (255, 1.0, 0); or even like $img->levelImage (-0.5, 1.0, 5.6); but without any success. Output image is either almost black or almost white. All other imagick methods I use work fine, but this one is just a back-breaker for

PHP pdf转png windows版本

ぐ巨炮叔叔 提交于 2019-12-01 22:45:37
链接: https://pan.baidu.com/s/1Bli-2HkucRTYTeujkcsmjg&shfl=sharepset 提取码:2une 1.php_imagick扩展    (1)下载php_imagick扩展   下载地址一: http://windows.php.net/downloads/pecl/releases/imagick/   下载地址二: https://pecl.php.net/package/imagick   要点: 注意对应php版本 ts还是nts x86还是x64   这里以phpinfo()为准 (2)安装    解压上述文件后,将php_imagick.dll复制到php/ext目录,或者其他你的存放拓展的目录   修改php.ini 加上extension=php_imagick.dll,注意php可能有多个ini,以phpinfo为准   此时复制解压上述文件目录中其他dll到php目录,重启apache,此时phpinfo显示拓展安装成功,但是 ImageMagick number of supported formats为0,到这里成功安装了一半 2.imagemagick程序  (1)imagemagick程序   下载地址: http://windows.php.net/downloads/pecl/deps/  

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

喜你入骨 提交于 2019-12-01 14:39:40
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 above. This works fine when the url ends in .jpg but fails on the above. As a note, I am converting

imagick | Gradient map

丶灬走出姿态 提交于 2019-12-01 11:30:30
问题 I'm trying to get this effect on images using imagick. In photoshop it's called a gradient-map, but I can't find anything similar to this in imagick. I think I need to make it black-and-white first, but I don't get how to add the colors after doing so. Hope you can help! Thanks --- EDIT: --- I'm using Imagick , not imagemagick. Notice there are two colors in the image, it's not just colorized. Dark blue for the darker colors, and light green/aqua for the lighter ones. 回答1: PHP Imagick Version

Imagick don't open pdf files with “Failed to read the file” exception

送分小仙女□ 提交于 2019-12-01 03:47:47
Trying to open PDF file from php script drop into fault with error: Uncaught ImagickException: Failed to read the file in ... I'm running OS X, Brew, PHP 7.0, php70-imagick --HEAD, ImageMagick --with-ghostscript, GhostScript Command line test works fine: convert 1.pdf 1.jpg File permission is ok. Try both, an URL and local file with realpath function, so filepath is ok too. Script works fine if open jpeg. phpinfo() -> ImageMagick supported formats: EPDF, PDF, PDFA, etc. UPDATE: Solved. Solution below. This problem was with path to ghostscript. It's locate in "/usr/local/bin", but this path is

Use two different fonts in imagemagick on one line

眉间皱痕 提交于 2019-12-01 01:08:19
So i want to draw on my image text lets say in this example "Trevor, 24" But I want to use the font Helvetica for Trevor, and for 24 i want to use the font Arial. But I want it to be on the same line and look like it's one. Is it possible or how would i go about making it so that even if i change the name and age, that i can print it out like this? "Trevor, (Helvetica) 24(Ariel)" I would assume to print them next to eachother, but if someone enters the name longer than Trevor 24 would go over it. the idea is to make it on the same line What do you guys think? $draw = new ImagickDraw(); $color

Outline a transparent image using imagick PHP

我的梦境 提交于 2019-12-01 01:05:40
问题 I have an image with a transparent background that I'd like to outline with a 5px border. In photoshop, I can stroke it to achieve this. I've tried using borderImage but it won't outline the penguin. $image = new Imagick(); $image->readImage('tux.png'); $image->borderImage(new ImagickPixel('red'), 5, 5); // no outline This is the image. This is what I want to achieve. 回答1: I'll start at the command line and may do the PHP later, or let you work that bit out... Step 1 - Extract transparency As