[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

How to install the WMF Component of ImageMagick

Posted on 2011-02-27
7
Medium Priority
?
1,378 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
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…
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

656 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