好的,我一直在陷入困境。我试图使用ImageMagick为成员个人资料图片添加一个“框架”(由于缺乏更好的用词)。我先设置框架图标,然后获取成员图片,但是在尝试保存文件时出现“无法读取文件”异常。
这是我的代码:
$overlapImage = new Imagick($current_dir . "/images/EmeraldPro.png");
// This is a local function written for me that returns the content directory and image name in one string.
$member_picture = $temp_account->get_ProfileImage($member, "140", "content");
$temp_member_picture = new Imagick($member_picture);
$temp_member_picture->compositeImage($overlapImage, Imagick::COMPOSITE_ATOP, 0, 0);
try{
$temp_member_picture->writeImage($dir.$newFileName);
} catch (ImagickException $e) {
print __LINE__."\n";
print $e->getMessage();exit;
}
任何帮助将不胜感激。