Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/297.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用phpimageworkshop以300 dpi的速度保存图像_Php_Image_Image Processing_Printing - Fatal编程技术网

使用phpimageworkshop以300 dpi的速度保存图像

使用phpimageworkshop以300 dpi的速度保存图像,php,image,image-processing,printing,Php,Image,Image Processing,Printing,您好,我正在开发一个屏幕打印应用程序,它有一个前端javascript定制程序,可以通过ajax将xml数据发送到我的服务器。 我正在使用 要生成最终定制的图像,除了最终输出文件以72 DPI的速度输出外,其他一切都正常工作,即使最初上传的图像是300 DPI。出于我的目的,我需要打印就绪300 DPI的最终输出,这里是生成的简单代码 <?php use PHPImageWorkshop\ImageWorkshop; // Use the namespace of ImageWorksho

您好,我正在开发一个屏幕打印应用程序,它有一个前端javascript定制程序,可以通过ajax将xml数据发送到我的服务器。 我正在使用

要生成最终定制的图像,除了最终输出文件以72 DPI的速度输出外,其他一切都正常工作,即使最初上传的图像是300 DPI。出于我的目的,我需要打印就绪300 DPI的最终输出,这里是生成的简单代码

<?php
use PHPImageWorkshop\ImageWorkshop; // Use the namespace of ImageWorkshop
require_once('PHPImageWorkshop/ImageWorkshop.php'); // Be sure of the path to the class
$pinguLayer = ImageWorkshop::initFromPath(__DIR__.'/images/cards-01.jpg');
echo $pinguLayer->getWidth();
echo $pinguLayer->getHeight();
//$pinguLayer->resizeInPixel(400, null, true);

$wwfLogoLayer = ImageWorkshop::initFromPath(__DIR__.'/images/wwf.png');
$tuxLayer = ImageWorkshop::initFromPath(__DIR__.'/images/tux.png');

/*$wwfLogoLayer->resizeInPixel(64, 64, true);
$tuxLayer->resizeInPixel(64, 64, true);
*/
$pinguLayer->addLayerOnTop($wwfLogoLayer, 20, 10, 'LB');
$pinguLayer->addLayerOnTop($tuxLayer, 20, 10, 'RT');

$dirPath = __DIR__."/exports/";
$filename = "pingu_edited.jpg";
$createFolders = true;
$backgroundColor = null; // transparent, only for PNG (otherwise it will be white if set null)
$imageQuality = 100; // useless for GIF, usefull for PNG and JPEG (0 to 100%)

$pinguLayer->save($dirPath, $filename, $createFolders, $backgroundColor, $imageQuality);
?>

是否仍有以300 DPI指定输出的方法