ImageMagick

CImg failed to recognize the format “jpeg”

半城伤御伤魂 提交于 2020-01-05 20:31:32
问题 To load image, I installed the CImg library in my mac(OSX 10.10). Luckily I managed to display the bmp picture, but I failed to load and display other formats like png or jpg. Then I installed the ImageMagic which is downloaded from http://cactuslab.com/imagemagick/ and then run the program. The errors are still there. My code is : #include "CImg.h" #include <stdlib.h> #define cimg_use_magick using namespace cimg_library; int main() { CImg<unsigned char> image("lena.jpg"); image.display();

php shell_Exec not working while the command works in shell

天大地大妈咪最大 提交于 2020-01-05 12:34:33
问题 I have to use imagemagick convert command from php. So I'm using shell_exec but the output of that is null string. I know that the command convert doesn't print anyting on STDOUT but the desired output of convert is also not achieved. also exec doesn't work. these commands run fine from shell or from php command line. What can be the issue? EDIT :adding the 2>&1, I learn that convert is throwing an error : missing an image filename /a5d98168a524a331c5e06d60096debd63cbdce1f.jpg' @ error

Inaccurate results from ImageMagick function queryFontMetrics

 ̄綄美尐妖づ 提交于 2020-01-05 12:33:19
问题 Imagick::queryFontMetrics does not seem to be working. When I use the metrics provided by queryFontMetrics to size the image, some fonts are still being cut off. Any ideas? Here's my code: if (!file_exists($cache['dirname'].'/'.$cache['basename'])) { try { $draw = new ImagickDraw(); $draw->setFont($font_path['dirname'].'/'.$font_path['basename']); $draw->setFontSize($size); $draw->setGravity(Imagick::GRAVITY_CENTER); $draw->setFillColor($color); $canvas = new Imagick(); $metrics = $canvas-

ImageMagick Error: Unable to open image

自闭症网瘾萝莉.ら 提交于 2020-01-05 10:33:23
问题 I'm using ImageMagick (Magick++) in my application but when trying to load an image I get the error: Unable to open image '??': Invalid argument @ error/blob.c/OpenBlob/2657 From reading other peoples problems online ?? is typically the file trying to be loaded, and I am obviously not passing the file location ?? to the loader - so it appears not to be able to resolve the string I am giving it. Tried using Unicode and Multi-byte. Copied project settings from example(s). File definitely exists

Eliminate slow speed factor in ffmpeg and image-magic commands

六月ゝ 毕业季﹏ 提交于 2020-01-05 09:13:29
问题 The basic idea of these commands is to create a compare, (A compare has defined a jpeg from past and one from the present, combine such as they will slide on each other and show before after images.) e.g. https://media.evercam.io/v1/cameras/1lowe-scnoe/compares/lower-jreyh.gif All the commands are written below, doing these operations Resize before after image. create a Gif using both images. Add a log to Gif. Create an MP4 file of from GIF. Create a thumbnail from mp4 file. the logo is: we

Creating array populated by images from a PDF using PHP and ImageMagick

北城余情 提交于 2020-01-05 09:03:44
问题 I'm trying to write a routine that will take a PDF submitted by a user, and extract each page as an image and then populate an array with those images. I've found several examples that append all pages to one image, but none that do what I need. This is what I have, but it returns an empty array: function PdfToImg($pdf_in) { $img_array = array(); $im = new imagick(); $im->readimageblob($pdf_in); // reading image from binary string $num_pages = $im->getnumberimages(); $im->setimageformat("png"

Computing distance of perceptual hashes

℡╲_俬逩灬. 提交于 2020-01-05 07:45:33
问题 I am using Imagemagick in order to get the perceptual hash of an image. I use the following command: identify -verbose -define identify:moments x.png The output returns amongst other params also the pereceptual hash: I1: 0.0017694 (0.451197) I2: 3.22345e-07 (0.0209605) I3: 2.88038e-10 (0.00477606) I4: 3.93968e-12 (6.53253e-05) I5: 1.2326e-22 (3.38892e-08) I6: -1.94034e-15 (-8.20426e-06) I7: -4.91938e-23 (-1.35254e-08) I8: 5.56374e-16 (2.35249e-06) Channel perceptual hash: Red, Hue: PH1: 0

ImageMagick: What is this convert-command doing?

丶灬走出姿态 提交于 2020-01-05 07:08:22
问题 I'm trying to port a PHP script to Ruby and until now I only used ImageMagick to convert from one file-format to another. Meaning: Yes, I'm an ImageMagick newbie. ;-) Somewhere inside the PHP script the following code is executed: $output = array(); $returnValue = 0; $cmd = 'convert '.$pngFile->path.' -resize 1x1 -alpha on -channel o -format "%[fx:u.a]" info:' exec($cmd, $output, $returnValue); Using the ImageMagick documentation for convert I identified the following options: -resize 1x1

Apply displacement map via Imagick after version update

☆樱花仙子☆ 提交于 2020-01-05 05:37:10
问题 I had the code running to create a "cylinder" effect via ImageMagick v6.7.9 and PHP (Imagick extension v3.2.0), it's like described in the accepted answer of my previous question: https://stackoverflow.com/a/54807019/1800172 It's inspired by Fred's cylinderize script: http://www.fmwconcepts.com/imagemagick/cylinderize/ After creating the X/Y-displacements ( $a3 / $a4 ) it's combined like this: // merge x-displacement and y-displacement into one displacement-map $displaceMask = new Imagick();

MinGW32: Linking against ImageMagick with -static flag

蓝咒 提交于 2020-01-05 04:35:07
问题 I am currently trying to build a Windows-version of emacs that supports ImageMagick. For that purpose I have already compiled ImageMagick with MinGW32/MSys in order to get compatible library files. Basically linking also works, though I have to add explicitly -llibMagickCore-6.Q16 and -llibMagickWand-6.Q16 to the linking command through configure.bat 's --lib option. However, the binary distribution of emacs for windows is supposed to load, even when the dependencies are absent. This