Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

TIFF Support in PHP

Posted on 2002-05-10
12
Medium Priority
?
3,414 Views
Last Modified: 2012-06-22
I am looking to read in a TIFF image and serve up a section of it as a GIF,JPG, or PNG to the browser.  I have gd setup and working but need to know if TIFF is supported (It doesn't seem to be).  If it isn't what external packages can I add in?  I have looked at ImageMagick, but I seem to need to run it from Exec() or PassThru() which don't work well for Windows.  My environment is Windows 2000 Server, Apache 1.3, and PHP 4.2

Thanks,

Matt
0
Comment
Question by:MatthewL
[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
  • 6
  • 5
12 Comments
 
LVL 4

Expert Comment

by:lokeshv
ID: 7001865
check this ..

http://www.phpbuilder.com/columns/rasmus19990124.php3


Hope it helps...

Lk
0
 
LVL 1

Author Comment

by:MatthewL
ID: 7002310
Hi lokeshv,

Thanks for the link ... I must be misunderstanding it though.  It appears to be about generating TTF's.  Am I missing something?

Matt
0
 
LVL 32

Expert Comment

by:Batalf
ID: 7002675
I have used imagemagick for windows

exec("convert originalImage.tif copy.gif");

Then you have a copy of "originalImage.tif" stored in "copy.gif"
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 32

Expert Comment

by:Batalf
ID: 7002676
But maybe you need the path to "convert.exe" on windows-platform.

Try to use relative path to convert.exe

exec("../relativePath/convert originalImage.tif copy.gif");
0
 
LVL 1

Author Comment

by:MatthewL
ID: 7004610
Hi Batalf,

I have been successful using exec() and passthru() on some simple programs (e.g. passthru("net view")), but haven't been successful in launching a more involved program.  ImageMagick would be a good solution if I can get it to work.  What did you need to setup on your system?  Do you know how to get convert() to give me a slice of the image?

Thanks,

Matt




0
 
LVL 32

Expert Comment

by:Batalf
ID: 7004641
On windows, I just installed the binary software from ftp://ftp.nluug.nl/pub/ImageMagick/binaries/ . Then I executed exec("../relativePath/convert.exe...") on it. But remember to use relative path to convert.exe.

To crop the image(get a slice of it), you could use the parameter -crop

For more information about crop, look at

http://www.imagemagick.org/www/convert.html

If you're willing to pay for the software, Alchemy Software from www.handmadesw.com is probably even better than ImageMagick. It's faster and supports more image-formats. But: ImageMagick is also good!

Batalf

0
 
LVL 1

Author Comment

by:MatthewL
ID: 7004843
Hi Batalif,

I will try ImageMagick again.  I also did a quick check on Alchemy, but they want $2.5K for the server license, which seems a little steep to me.  Have you noticed any runtime lags with ImageMagick that would move me toward a solution like Alchemy?

Matt
0
 
LVL 32

Accepted Solution

by:
Batalf earned 800 total points
ID: 7004875
The reason to use Alchemy instead of ImageMagick are:

* Alchemy process imageconvertion faster than ImageMagick.
* ImageMagick seems to have problems with some image-formats. We experienced some problems converting eps-files created in a program called "Freehand". The problem was some font files which wasn't a part of the ImageMagick software. When we installed Alchemy, convertion of eps from freehand worked in both Alchemy and Freehand.

I think that ImageMagick is a good choice if you're not dealing with very large images, like eps-images on 20-30 MB.

Batalf
0
 
LVL 1

Author Comment

by:MatthewL
ID: 7005054
Hi Batallf,

Sounds like I might end up going to Alchemy (my files are 1-2G).  I think I will start with ImageMagick and prove that the run time is unacceptable first.  I am thinking this way as the slices will be small, and the large images can sit in memory on the server.  I notice in your profile you have a Java background.  Is there a PHP equivalent to EJBs?  I am thinking perhaps DCOM, but don't want to miss an obvious choice.

Thanks,

Matt

I have also been looking at ImageMagick and it appears that convert() will not allow me to pipe.  Is that correct?
(I want to avoid file creation).
0
 
LVL 32

Expert Comment

by:Batalf
ID: 7005503
There has been a while since I worked with Java, I don't think php have anything like javas EJB(Enterprise Java Beans).

But I know that ImageMagick has become a part of the php-library "pear" (http://pear.php.net). So that could be a choice. ( I haven't used pear yet though).

About pipe:
What do you mean by that you want to avoid file creation? When you use ImageMagick or Alchemy, the converted file has to be stored into a file. Please explain if I'm way of.



0
 
LVL 1

Author Comment

by:MatthewL
ID: 7006044
Hi Batalf,

I thought the EJB question would be worth a try.  You have long before earned your points however.  I will look into pear.

By pipe I mean I want take the stdout of one program and use it as the stdin of the next.

e.g. I have the following in an old solution.  

ImageStream.exe -bunchOParams -targa $file | cjpeg.exe -targa

An image is streamed in targa format to stdin of cjpeg which then converts to a jpeg for me and it's stdout goes directly to my browser.

I would like to do a simular solution with convert, but it doesn't seem to support it.  If you know of source code for convert I could hack it though.

P.S. what is a eps file? (just curious)

thanks,

Matt
0
 
LVL 32

Expert Comment

by:Batalf
ID: 7006061
Thanks for the points.

Eps = "Encapsulated PostScript" = Postscript-image.
0

Featured Post

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

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…
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…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

636 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