简体   繁体   中英

How to convert images (GIF, JPG, JPEG, PNG) to TIFF in PHP?

How can I convert images to .tiff with php? (im testing on win xp)

I remember I used imagemagick to do this but I cant find the code now, and couldnt find any example on google.

A code sample will be appreciated.

Also, is there a way to do it without imagemagick?

Following is the code sample that might be helpful for you.

<?php
try
{
  $image = new Imagick("testing.jpg");
  $image->writeImage("page.tiff");
}
catch(Exception $e)
{
  echo $e->getMessage();
}
?>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM