不使用Imagick在PHP中将TIFF图像转换为PNG/JPG/GIF [英] Converting a TIFF image to PNG/JPG/GIF in PHP without Imagick

查看:384
本文介绍了不使用Imagick在PHP中将TIFF图像转换为PNG/JPG/GIF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为我的客户处理一个网站,在该网站中,tiff图像在组装成PDF之前需要转换为png或jpg.

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

在此问题和其他站点上,我已经阅读了许多文章.他们都建议使用Imagick来完成此任务.问题是,我的客户的服务器未安装该扩展程序,托管公司不愿意安装该扩展程序.

I have read many articles, here and other sites, on this issue. They all recommend using Imagick to accomplish this. The problem is, my client's server does not have that extension installed, and the hosting company is unwilling to install the extension.

服务器上也未安装PDFLib(支持将tiff导入PDF).

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

谢谢.

推荐答案

由于tiff格式,这很棘手.您可以使用本机PHP函数对大多数输入格式执行此操作,以从源文件创建图像对象,然后使用imagejpeg或imagepng保存该对象.但是tiff存在专利问题,我不认为这是受支持的.查看服务器上可用的PHP GD和映像功能.可能对此处的注释有所帮助: http://php. net/manual/en/function.pdf-open-image-file.php

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

这篇关于不使用Imagick在PHP中将TIFF图像转换为PNG/JPG/GIF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆