如何在PHP中将图像的dpi设置为300

如何在PHP中将图像的dpi设置为300,php,zend-framework,Php,Zend Framework,我想将PHP中现有图像的DPI更改为300 我在数据库中有这个图像,我是通过PHP获得它的 获取图像的代码如下所示: $image = imagecreatefromstring ( base64_decode($matches[2]) ); imagepng($image, $imageFile); 我想将上面图像的DPI设置为300 我正在使用Zend框架 如何使用PHP进行设置 请帮帮我。我会用imagemagic做这项工作 $oResamp = new Resampler; $ima

我想将PHP中现有图像的DPI更改为300

我在数据库中有这个图像,我是通过PHP获得它的

获取图像的代码如下所示:

$image = imagecreatefromstring ( base64_decode($matches[2]) );

imagepng($image, $imageFile);
我想将上面图像的DPI设置为300

我正在使用Zend框架

如何使用PHP进行设置


请帮帮我。

我会用imagemagic做这项工作

$oResamp = new Resampler;
$image = $oResamp->resample($source, $height, $width, 300);