Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
matthewst
Post
by matthewst » 2007-08-20T07:36:44-07:00
This works in terminal
Code: Select all
convert images/image.pdf images/image.jpg
but not in php
So far I have tried:
gave execute permissions to entire site (for testing)
run the command in terminal
set php safemode to off
various php commands:
Code: Select all
exec ("convert images/image.pdf images/image.jpg");
//exec ("usr/local/bin/convert images/image.pdf[0] images/image.jpeg");
//$command = "env";
//echo($command);
//system($command);
//echo "<br/><br/>";
//
//$entree = "images/image.pdf";
//$sortie = "images/image.jpg";
//$command = "convert -debug all -verbose $entree $sortie";
//echo($command);
//system($command);
//echo (file_exists($sortie)) ? 1 : 0;
//echo "<br/><br/>";
//exec("/usr/local/bin/convert images/image.pdf images/image.jpg");
I am running apache on xserve using imagemagick v. 6.3.5 and ghostscript v. 8.54 both installed with macports.
Bonzo
Posts: 2971 Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England
Post
by Bonzo » 2007-08-20T08:37:22-07:00
The code below works for me
Code: Select all
// Convert whole pdf document - 3 pages to 3 images
exec("convert instructions.pdf instructions.jpg");
// Convert first page to image
exec("convert instructions.pdf[0] instructions_1.jpg");
Dose this give you any output ?
Code: Select all
exec("convert instructions.pdf instructions.jpg 2>&1", $array);
echo "<br>".implode($array,"<br>");
Out of interest will any other comands work in php ? e.g. resizing a jpg etc.
matthewst
Post
by matthewst » 2007-08-20T09:10:43-07:00
Thanks for the help!!
I got this:
Code: Select all
dyld: Library not loaded: /usr/X11R6/lib/libdpstk.1.dylib
Referenced from: /usr/local/bin/convert
I then copied libdpstk.1.
0 .dylib (couldn't find libdpstk.1.dylib) to /usr/X11R6/lib and renamed it the libdpstk.1.dylib
then got this:
Code: Select all
/usr/X11R6/lib/libdpstk.1.dylib: mmap() error 22 at address=0x8AA16000, size=0x00001824 in Segment::map() mapping /usr/X11R6/lib/libdpstk.1.dylib
Bonzo
Posts: 2971 Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England
Post
by Bonzo » 2007-08-20T09:29:38-07:00
You are beyond me now; I can get the code to run but have no idea how it works !
Hopefuly magick or Anthony can help you out.
matthewst
Post
by matthewst » 2007-08-20T10:01:36-07:00
I searched fot libdpstk.1.1dylib on google and only found people with the same problem I'm having.
matthewst
Post
by matthewst » 2007-08-20T10:56:29-07:00
Has anyone been able to get this to work on OSX?
matthewst
Post
by matthewst » 2007-08-21T04:46:27-07:00
Does anyone have a copy of libdpstk.1.1dylib? Is anyone willing to upload it so I can download it?
matthewst
Post
by matthewst » 2007-08-21T08:13:16-07:00
Magick?...Anthony?...Anyone?...
I could really use some help.
matthewst
Post
by matthewst » 2007-08-22T05:37:07-07:00
Hello...
anthony
Posts: 8883 Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia
Post
by anthony » 2007-08-22T21:39:33-07:00
Sorry I don't have MacOSX so can't help. Does it work from the command line?
If yes, then you have a environment problem. like LD_LIBRARY_PATH under UNIX and Linux. But I have no idea for Mac.