?
Solved

How to install the WMF Component of ImageMagick

Posted on 2011-02-27
7
Medium Priority
?
1,361 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Use Filtering Commands to Process Files in Linux

Learn how to manipulate data with the help of various filtering commands such as `cat`, `fmt`, `pr`, and others in Linux.

 
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

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.

Question has a verified solution.

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

Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

801 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