JPEG元数据的最大大小是多少? [英] What is the maximum size of JPEG metadata?

查看:170
本文介绍了JPEG元数据的最大大小是多少?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在JPEG文件中可以合并的元数据量(EXIF等)是否存在理论上的最大值?我想分配一个缓冲区,以确保足以容纳任何JPEG图像的元数据,而不必自己解析.

Is there a theoretical maximum to the amount of metadata (EXIF, etc) that can be incorporated in a JPEG file? I'd like to allocate a buffer that is assured to be sufficient to hold the metadata for any JPEG image without having to parse it myself.

推荐答案

没有理论上的最大值,因为某些APP标记可以多次使用(例如,EXIF标头和XMP块均使用APP1).而且,没有什么可以阻止多个注释块.

There is no theoretical maximum, since certain APP markers can be used multiple times (e.g. APP1 is used for both the EXIF header and also the XMP block). Also, there is nothing to prevent multiple comment blocks.

实际上,导致报头较大的一种更为常见的方法是专门使用APP2标记来存储图像的ICC颜色配置文件.由于某些复杂的颜色配置文件可能为数兆字节,因此实际上它会被分成许多APP2块(因为每个APP块都有一个16位的寻址限制).

In practice the one that is much more common to result in a large header is specifically the APP2 marker being used to store the ICC color profile for the image. Since some complicated color profiles can be several megabytes, it will actually get split into many APP2 blocks (since each APP block one has a 16bit addressing limit).

这篇关于JPEG元数据的最大大小是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆