Solved

How to install the WMF Component of ImageMagick

Posted on 2011-02-27
7
1,313 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Question has a verified solution.

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

Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
This article discusses how to create an extensible mechanism for linked drop downs.
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

911 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now