?
Solved

How to install the WMF Component of ImageMagick

Posted on 2011-02-27
7
Medium Priority
?
1,401 Views
Last Modified: 2012-05-11
I'm running a Debian 6.0 server on which I have successfully installed Apache, PHP, MySQL, and various PHP plugins, including ImageMagick.  I am trying to use ImageMagick to convert some WMF files to a useable format.  I installed the following components successfully and then rebooted the machine:
# apt-get install imagick-bin
# apt-get install php5-imagick
# apt-get install libwmf-bin

Open in new window

I have the following PHP code:
<?php
try{
	$filename = 'foo.wmf';
	$im = new Imagick();
	$h = fopen($filename, 'rb');
	$im->readImageFile($h);
	$im->setImageFormat('png');
	
	header("Content-Type: image/png");
	print $im->getImageBlob();
}catch(Exception $e){
	echo $e->getMessage();
}
?>

Open in new window

But when I run this code, I get the following message:
unable to open file `/tmp/magick-XXK6kbGr': @ error/constitute.c/ReadImage/572
ImageMagick works when I try to convert a JPEG file, but not this WMF file.

What is going wrong?
0
Comment
Question by:sffc
  • 4
  • 2
7 Comments
 
LVL 3

Expert Comment

by:eappiah
ID: 34995706
Hello

Did you enable the extension in php.ini?
If you do a <? phpinfo()  ?> can you find anything about ImageMagick?

0
 
LVL 6

Expert Comment

by:mohansahu
ID: 34995980
Hi,

need libwmf - library for converting WMF files

have a look in the below link ,it might be help you.

http://wvware.sourceforge.net/libwmf.html

MS
0
 
LVL 1

Author Comment

by:sffc
ID: 35000338
Thanks for your responses!  Here is what phpinfo() says about ImageMagick:

phpinfo() on ImageMagic extension
I'm using the "apt-get" utility in Debian to install everything.  I said in my initial post that I have already run "apt-get install libwmf-bin", which I believe is the command that installs libwmf.  If it means anything, there are four packages that start with "libwmf" available to apt-get install:
libwmf0.2-7  libwmf-bin   libwmf-dev   libwmf-doc
Would it be beneficial to additionally install one of those?

Any other suggestions?
0
Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

 
LVL 1

Author Comment

by:sffc
ID: 35013320
To follow up with my last post, I ran this command:
apt-get install libwmf*

Open in new window

I rebooted the computer, but I'm stillg etting the same error.

How do you use iMagik in the command line so that I can see whether it's PHP's problem or iMagik's problem?
0
 
LVL 1

Accepted Solution

by:
sffc earned 0 total points
ID: 35013888
Okay, I found a way to make it work.  I ran the command:
apt-get install imagemagick

Open in new window

It seems that I had never actually installed ImageMagick!  Wow…
0
 
LVL 6

Expert Comment

by:mohansahu
ID: 35014611
Try in command line..

display <imagename>, check its getting image or not
0
 
LVL 1

Author Closing Comment

by:sffc
ID: 35178874
The problem was resolved after I ran the command above.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Fine Tune your automatic Updates for Ubuntu / Debian
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses
Course of the Month15 days, 15 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question