imagick

Outputing resized animated gif to browser using imagick

I intent to resize an animated gif and outputing it to the browser on-the-fly. My problem is that when I save the resized image it is of good quality, but if I echo it to the browser it is of poor quality and the animation is removed. Here is the code:` header("Content-type:image/gif"); try { /* Read in the animated gif */ $anim...

PHP Imagick "wand contains no images"

Hi all, When attempting to do a simple conversion from PHP, I receive this error : exception 'ImagickException' with message 'wand contains no images `MagickWand-2' @ error/magick-image.c/MagickSetImageFilename/10080' What is MagickWand doing there ?? I did not install it... Here is my simple code : $a = "/[...]/test.jp...

How I can disable font smoothing on imagick?

I use php+imagick and can not turn off font smoothing. When I used the GD, could simply set a negative font color and smoothing switching off. ...

Imagick (Imagemagick on PHP): serve a file without saving to disk first?

I'm trying to use Imagemagick (actually PHP's Imagick) to create and output (serve) an image without saving it to disk first. Currently I'm having to save the file and then use verot upload class to serve the image. I'm hoping there's something simple that I'm missing. Any suggestions/advice will be much appreciated. (Apache 2 server...

Change background from white to transparent in imagemagick

Hi, I'm importing SVGs with imagick using this syntax $graphic = new Imagick($this->img); The problem is this image is imported with a white background. How can I change the white background to a transparent one, or make imagick keep then transparent background when importing the SVG. ...

Header location not working properly

I have a php script that renders an image (with imagick) and saves it to some directory "SITE_ROOT.$filePath", then does a header('Location: ' . SITE_ROOT.$filePath), the file it redirects to is a png image. If I go to the path directly, like just type it in the URL bar I can save the image and everything works fine, however when I rel...

URL input in imagick class dosnt work!

how to convert pdf URL to png ? Hi, I convert my local pdf file pages to png files by this code: $im = new imagick($url . '[' . $i . ']'); $im->setImageFormat("png"); $im->writeImage($thisFile); this code works only when my pdf file exists on my local (for example $url = "./pdf_files/test.pdf"), a local file path. but, if I change it...

PHP Imagick setImageOpacity destroys transparency and does nothing

Here's the thing. I hava a simple snippet in PHP like this regarding a transparent image: $im = new Imagick('some-transparent-image.png'); $im->setImageOpacity(0.3); $im->writeImage('output.png'); The file output should be a transparent image with lower opacity, right? Well, the output is an image with black color where it was supp...

Does Imagick Support Radial Gradients ?

Hi, PROBLEM When using Imagick::newPseudoImage to create a radial gradient, this error appears in the Apache HTTP error log and the radial gradient is not created: PHP Fatal error: Uncaught exception 'ImagickException' with message 'Unable to create new pseudo image: radial-gradient:#FF0000-#FFFFFF' in /var/www/html/energy/s...

resizing with php imagick

I am uploading images and resizing them to 300x200 pixels i'm using the imagick extension and specifically the adaptiveResizeImage() function. when uploaded using bestfit there is a lot of whitespace on the sides of the image (depending on portrait or landscape). what i'd rather it did was resize to fill the entire area (no whitespace...

rounding individual corners with php/imagick

is it possible to round individual corners with the imagick extension? imagick::roundedCorners() seems to only do all 4 corners ...

imagick binary to count number of pages in a pdf file

Hi Could someone suggest the php code using exec() function to execute a binary of imagick to count the pages in a pdf file. Any suggestions would be great. Thanks! Regards Rahul ...

right path of image being referred to in exec() in php

Hi I am trying to use the following script to count the number of pdf pages in a pdf file. $filename = $_ENV{'HOMEDIR'}."/www/path/to/pdf/file"; $cmd = "/usr/local/nf/bin/identify -density 12 -format '%p' '$filename' "; $out = array(); exec($cmd,$out,$error); foreach($out as $f=>$v) { echo "$f = $v "; } However I get no outp...

Imagick doesn't render svg opacity properly.

First image was properly exported by Inscape, second by following code. I need same output from inkscape and imagick. PHP code: <?php $im = new Imagick(); $im->setResolution(400,400); $im->setBackgroundColor(new ImagickPixel('transparent')); $im->readImageBlob(str_replace(array("color1", "color2"), array("yellow", "blue"), file_ge...

facebook image manipulation

I'm looking to save some time in making a facebook app that adds a watermark to profile pictures of users, given the authority. Has anyone done something like this in using php? ...

How to isolate only one colour on image with PHP?

Is it possible to leave (isolate) only one colour in image? Currently I'm interested in green:005d00 ...

creating a box with an image

I'd like to take an image and turn the corners over to make a box (like a canvas painting) i have gd library, imagemagick installed on the server and imagick php extension installed. is it possible? any help appreciated ...

Imagick Wrong JPEG library version

I'm trying to resize some images using PHP and Imagick, however when I do so I get this error: ImagickException: Wrong JPEG library version: library is 80, caller expects 62 There's very little on internet about the problem, although there are a few questions on stackoverflow about it. I can't see any solutions posted to any though. D...

How to convert .PDF file to .PNG using Imagemagick PHP api

Hello i want to convert .pdf file to .png file using Imagemagick php API. we can do this from shell using this: $convert sample.pdf sample_image.png we can issue this command using php exec() function but due to some reason(security) i disabled the execution of shell commands using php. so now tell me the solution that how can i c...

output a PDF file using imagic and PHP

i have some pdf's that are stored in a SQL server with data type Image. Now I want to merge them into a single document with Imagic from a PHP page. here is the code $combined = new Imagick(); while( $document = mssql_fetch_assoc( $mssqlResult ){ $image = new Imagick(); $image->readImageBlob( $document['Cont...