有没有办法将版权信息添加到由创建的图像文件中PHP
?
为了更清楚,您可以copyright
使用 Photoshop 将信息添加到文件中,因此当您获取它时properties
,您会看到类似于以下内容的内容:
我想在 php.ini 中添加/编辑文件的详细信息。有可能吗?
编辑:
我从用户输入中获取图像,然后使用此函数调整其大小:
function image_resize($src, $w, $h, $dst, $width, $height, $extension )
{
switch($extension){
case 'bmp': $img = imagecreatefromwbmp($src); break;
case 'gif': $img = imagecreatefromgif($src); break;
case 'jpg': $img = imagecreatefromjpeg($src); break;
case 'png': $img = imagecreatefrompng($src); break;
default : return "Unsupported picture type!";
}
$new = imagecreatetruecolor($width, $height);
// preserve transparency
if($extension == "gif" or $extension == "png"){
imagecolortransparent($new, imagecolorallocatealpha($new, 0, 0, 0, 127));
imagealphablending($new, true);
imagesavealpha($new, false);
}
imagecopyresampled($new, $img, 0, 0, 0, 0, $width, $height, $w, $h);
imageinterlace($new,1);//for progressive jpeg image
switch($extension){
case 'bmp': imagewbmp($new, $dst); break;
case 'gif': imagegif($new, $dst); break;
case 'jpg': imagejpeg($new, $dst); break;
case 'png': imagepng($new, $dst); break;
}
return true;
}