【发布时间】:2016-03-10 10:01:11
【问题描述】:
有没有办法使用 php 将元数据(例如关键字)添加到几个 png 图像?我已经将图像存储在我的数据库中,并且我想对它们相应的关键字做同样的事情,但是我还没有找到任何有用的使用 php 的建议。谢谢
image.php
<!DOCTYPE html>
<html lang="en">
<head>
<title>Upload Images</title>
</head>
<body>
<form action="tags.php" method="POST" enctype="multipart/form-data" >
<p>Select Image (one or multiple):</p>
<input type="hidden" name="MAX_FILE_SIZE" value="536870912"/>
<input type="file" name="image[]" accept="image/png" accept="image/jpg" accept="image/jpeg" accept="image/gif" multiple="multiple" />
<input type="submit" value="Upload file" name="submit" />
</form>
</body>
</html>
tags.php(猛禽的回答)
<?php
include('../config.php');
$image = new Imagick();
$image->readImage("C:/xampp/htdocs/cmanager/uploads");
$image->setImageProperty('keywords', 'Imagick');
print($image->getImageProperty('keywords'));
【问题讨论】:
标签: php database image png metadata