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

问题描述:

我想要将图像DPI更改为300,以获取PHP中的现有图像。如何在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);