开发者

Getting exif data from an image online with python

开发者 https://www.devze.com 2023-03-27 12:56 出处:网络
Hi Is there a way to read exif data from a online image given its url without downloading the im开发者_StackOverflowage? Right now I\'m doing something like:

Hi Is there a way to read exif data from a online image given its url without downloading the im开发者_StackOverflowage? 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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号