exif标记在图像中的什么位置?

2024-06-16 10:55:04 发布

您现在位置:Python中文网/ 问答频道 /正文

在Python中,如何找到EXIF标记在图像文件中的位置?我假设它是在文件的开头,但我有一些专有的图像格式,并希望确保总是这样。谢谢。在


Tags: 文件标记图像文件图像格式exif
1条回答
网友
1楼 · 发布于 2024-06-16 10:55:04

这不仅取决于EXIF-iself,还取决于文件类型。在

我假设您对JPEG文件感兴趣,所以看一下wikipedia page我看到以下段落:

Strictly speaking, the JFIF and Exif standards are incompatible because they each specify that their marker segment (APP0 or APP1, respectively) appears first. In practice, most JPEG files contain a JFIF marker segment that precedes the Exif header. This allows older readers to correctly handle the older format JFIF segment, while newer readers also decode the following Exif segment, being less strict about requiring it to appear first.

因此,至少对于JPEG文件,您可能会找到一些图像,其中Exif头不出现在文件的开头。在

相关问题 更多 >