我正在尝试使用php代码从.jpg文件中提取照片的“星级”评级。我的意图是将评分最高的图像显示为幻灯片的一部分。我发现使用PHP_JPEG_Metadata_Toolkit_1.11时,如果在Vista中设置了评级(右键单击->属性-> Details ->,通过单击stars来设置评级),则我能够通过读取Metadata_Toolkit返回的数组来获得文件的评级
`$exif = get_EXIF_JPEG( $photodir . "/" . $filename );` `$rating = $exif[0][18246]['Data'][0];` 但是,如果我使用Adobe Bridge设置评级,我可以在Vista中看到“stars”,但
$exif[0][18246]['Data'][0]返回空值。
PHP代码是否可用于读取Windows Vista和Adobe Bridge应用的评级?
发布于 2010-06-16 12:45:02
我发现Adobe Bridge将评级存储在jpeg文件中与Vista不同的位置。详情请参阅Suggested php code to read file rating set by Adobe Bridge CS3上的帖子
发布于 2010-06-11 13:00:02
难倒我了,但你为什么不自己去弄清楚:
$exif = get_EXIF_JPEG( $photodir . "/" . $filename );
print_r($exif);这将打印$exif的内容,我猜这会很大,但是您有时间,对吧?(在您的web浏览器中查看源代码,以便您可以正确地查看其格式。)向下钻取以找到关键字0,然后是关键字18246,然后是关键字数据,最后是关键字0。这就是你已经找到的。现在搜索其他评级可能在哪里。希望它不会太难找到。当你找到它的时候,记下它的路径。然后得到它:
// This is your Vista rating
$rating = $exif[0][18246]['Data'][0];
if ($rating == null) {
// no Vista rating, so get the Bridge rating
$rating = $exif[...fill in this path...];
}https://stackoverflow.com/questions/3020200
复制相似问题