Convert TIFF images to PNG / JPG / GIF in PHP without Imagick

I am working on a website for my client in which tiff images need to be converted to png or jpg before they are compiled into PDF.

I have read many articles, here and other sites, on this subject. All of them recommend using Imagick for this. The problem is that my client server does not have this extension, and the hosting company does not want to install the extension.

Nor is a PDFLib installed on a server (which supports importing tiffs to PDF).

Thanks.

+6
source share
1 answer

This is tricky due to the tiff format. You can do this for most input formats using native PHP functions to create an image object from the source file, and then save it using imagejpeg or imagepng. But tiff has problems with patents, and I don't think it is supported. Take a look at the PHP GD features and images available on your server. There may be some help in the comments here: http://php.net/manual/en/function.pdf-open-image-file.php

+2
source

Source: https://habr.com/ru/post/949062/


All Articles