使用python在线获取图像的exif数据
您好,有没有一种方法可以从给定 url 的在线图像中读取 exif 数据,而无需下载图像?现在我正在做类似的事情:
import urllib, pyexiv2
urllib.urlretrieve(url, File)
exif_info = pyexiv2.ImageMetadata(File)
exif_info.read()
print exif_info.exif_keys
但我想在没有下载步骤的情况下直接从互联网上阅读。这可能吗?
编辑:为了清楚起见,我所指的网址类似于 http://www.site.com /标志.jpg
Hi Is there a way to read exif data from a online image given its url without downloading the image? Right now I'm doing something like:
import urllib, pyexiv2
urllib.urlretrieve(url, File)
exif_info = pyexiv2.ImageMetadata(File)
exif_info.read()
print exif_info.exif_keys
but I'd like to do it without the download step and read directly from the internet. Is that possible?
Edit: Just to be clear the url I'm referring to is something like http://www.site.com/logo.jpg
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
实际上,“直接从互联网上读取”的说法称为下载。
如果您只能下载文件的某些部分,那是可能的。但我认为这是不可能的,特别是因为你无法确定 EXIF 数据在文件中的位置。
Actually, the statement "read directly from the internet" is called download.
If you were able to download only some part of the file, it would be possible. But I don't think it's possible, specially because you can't determine where the EXIF DATA is in the file.
除非网站公开该元数据,否则在您读取图像之前无法“读取”它。
Unless the website exposes that metadata, there is no way to "read" it until you have read the image.