I have a server which holds TIFF images. Most clients can read and display TIFF images, so there\'s no problem. However, some clients can\'t handle this format but can handl
Tifs can have more than one page so a more comprehensive approach is needed. Here is an example:
//given uploaded file $filename
$ext = strtolower(substr($filename, strrpos($filename, '.') + 1));
if ($ext == 'tif' || $ext == 'tiff') {
$images = new Imagick($upload_path . $filename);
//if you want to delete the original tif
unlink($upload_path . $filename);
$name = strtolower(substr($filename, 0, strrpos($filename, '.')));
$filename = $name . '.png';
foreach ($images as $i => $image) {
$image->setImageFormat("png");
$image->writeImage($upload_path . $i . $filename);
}
}