Convert tiff to jpg in php?

后端 未结 3 642
梦如初夏
梦如初夏 2020-11-30 08:10

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

3条回答
  •  一生所求
    2020-11-30 08:22

    I solved this using "convert" and ImageMagick, rather than having to install it as a DLL. Which was actually the best decision ever, because it solved the problem for PDFs as well. So I simply use:

    $command = "convert ".$filename."[0] ".$destination;
    exec($command);
    

    The [0] is there for PDFs, so it will always take the first page, but it works as is for TIFF too.

    All you need now is to have 'convert' on your Windows Machine and the above PHP will work for both. So simply install this.

提交回复
热议问题