获取照片“星星”;使用 PHP 进行评级
我正在尝试使用 php 代码从 .jpg 文件中提取照片“星星”评级。我的目的是将评分最高的图像作为幻灯片的一部分显示。我发现,使用 PHP_JPEG_Metadata_Toolkit_1.11,如果在 Vista 中设置评级(右键单击 -> 属性 -> 详细信息 -> 通过单击星星设置评级),我可以获得文件的评级Metadata_Toolkit 返回的数组
$exif = get_EXIF_JPEG( $photodir . "/" . $filename );
$评级 = $exif[0][18246]['数据'][0];
但是,如果我使用 Adobe Bridge 设置评级,我可以在 Vista 中看到“星星”,但$exif[0][18246]['Data'][0] 返回空值。
PHP 代码是否可用于读取 Windows Vista 和 Adobe Bridge 所应用的评级?
I am trying to extract the photo 'stars' rating from .jpg files using php code. My intent is to show the highest rated images as part of a slideshow. I found that using the PHP_JPEG_Metadata_Toolkit_1.11 I am able to get the rating of the file if the rating is set from within Vista (Right click -> Properties -> Details -> Set rating by clicking on stars) by reading the array returned by the Metadata_Toolkit
$exif = get_EXIF_JPEG( $photodir . "/" . $filename );
$rating = $exif[0][18246]['Data'][0];
However if I set the rating using Adobe Bridge, I can see the 'stars' in Vista, but the$exif[0][18246]['Data'][0]
returns a null value.
Is PHP code available to read the ratings applied by both Windows Vista AND Adobe Bridge?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
难倒了我,但你为什么不自己找出答案:
这将打印
$exif
的内容,我猜它会很大,但你有时间,对吧? (在 Web 浏览器中查看源代码,以便您可以看到其格式正确。)向下钻取以查找键 0,然后键 18246,然后键 Data,然后键 0。这就是您已经找到的键。现在搜索其他评级可能在哪里。希望它不是太难找到。找到它后,记下它的路径。然后获取它:Beats me, but why don't you find out for yourself:
This will print the contents of
$exif
, which I'm guessing will be large, but you've got time, right? (View the source in your web browser so you can see it properly formatted.) Drill down to find key 0, then key 18246, then key Data, then key 0. That's the one you already found. Now search for where the other rating might be. Hopefully it's not too hard to find. When you find it, take note of the path to it. Then to get it:我发现 Adobe Bridge 将评级存储在 jpeg 文件中的位置与 Vista 不同。请参阅以下帖子中的详细信息:用于读取 Adobe Bridge CS3 设置的文件评级的建议 php 代码
I found that Adobe Bridge stores the rating in a different location in the jpeg file than Vista. See details in the post found at Suggested php code to read file rating set by Adobe Bridge CS3