嗯,正如标题所说,我有一个问题。我的测试函数是这样的:
$imagePath="/tmp/511a3874a0da1";
$pngName=$imagePath.".png";
$tifName=$imagePath.".tif";
$tempImg = new Imagick();
$tempImg->readImage($pngName);
//$tempImg->roundCorners(150,150);
//$image->transformImage("100x100", "100x100");
$tempImg->setFormat('ptif');
$tempImg->setImageColorSpace(5);
$tempImg->writeImage($tifName);嗯,它会生成一个tif文件,就像手册上说的,ptif是‘平铺金字塔tiff’的格式。我检查了imagemagick命令行工具,通常应该是这样的:
convert 511a38e9a5cc5.png -define tiff:tile-geometry=256x256 -compress jpeg 'ptif:o.tif'我测试了这个命令,它可以工作。但在php中,我似乎无法设置瓦片几何形状。当我测试php生成的tif文件时,iipimage服务器日志告诉我这个文件没有平铺。有人知道如何制作平铺金字塔吗?纯粹通过php,而不是像"exec xxx“这样的东西。
发布于 2016-05-09 16:32:05
我不是很熟悉平铺金字塔,但可能是这样的:
<?php
$tempImg = new Imagick();
$tempImg->readImage("image.png");
$tempImg->setFormat('ptif');
$tempImg->setImageDepth(8);
$tempImg->setOption('tiff:tile-geometry','256x256');
$tempImg->writeImage("result.tif");
?>https://stackoverflow.com/questions/14834989
复制相似问题