位图文件的哪一部分是元数据? [英] Which part of a bitmap file is metadata?
问题描述
我一直在修改位图文件,并且得到了一些非常奇怪的结果.我想我可能不小心更改了元数据的一部分.元数据是哪一部分,所以我知道将其排除在我正在执行的二进制操作之外?
I have been modifying bitmap files, and I've been getting some very strange results. I think I may accidentally be changing part of the metadata. Which part is the metadata, so I know to leave it out of the binary manipulation I am doing?
我正在寻找一个答案,该答案告诉我哪些字节是元数据的一部分,而不管它们是在文件的开头还是结尾.元数据是指不属于像素的任何内容.
I am looking for an answer that tells me which bytes are part of the metadata, whether they are at the beginning or end of the file. By metadata I mean anything that isn't part of a pixel.
推荐答案
简单故障
有两种Windows位图文件:
Simple Breakdown
There are two kinds of Windows Bitmap file:
- DDB-设备相关位图(位图版本1)
- DIB-与设备无关的位图(位图版本2-5)
DDB文件有两个部分:
There are two parts to a DDB file:
- 标题/元数据
- 像素数据
检测DDB文件并按以下方式偏移:
Detect a DDB file and Offset by:
- 第一个 WORD = 0x0000
- 像素数据的偏移量始终= 10
- The first WORD = 0x0000
- The offset for the Pixel Data is always = 10
DIB文件包含三个部分:
There are three parts to a DIB file:
- 标题/元数据
- 数据
- 颜色配置文件(仅适用于第5版)
页眉/元数据分为三部分
There are three parts to the Header/Metadata
- DIB文件信息
- DIB图片信息
- 颜色表
检测DIB文件并按以下方式偏移:
Detect a DIB file and Offset by:
- 第一个 WORD = 0x4D42
- 像素数据的偏移量存储在 DWORD 中的字节 10
- DIB版本基于位于 DWORD 中字节 14 上的标头 size
- 版本2 = 12
- 版本3 = 40
- 版本4 = 108
- 版本5 = 124
- The first WORD = 0x4D42
- The offset for the Pixel Data is stored in the DWORD at byte 10
- The DIB version is based upon the header size located in the DWORD at byte 14
- Version 2 = 12
- Version 3 = 40
- Version 4 = 108
- Version 5 = 124
- http://msdn.microsoft.com/zh-我们/library/windows/desktop/dd183392.aspx
- http://fileformats.archiveteam.org/wiki/BMP
- http://www.fileformat.info/format/bmp/egff.htm
- http://en.wikipedia.org/wiki/BMP_file_format
- http://msdn.microsoft.com/en-us/library/windows/desktop/dd183392.aspx
- http://fileformats.archiveteam.org/wiki/BMP
- http://www.fileformat.info/format/bmp/egff.htm
- http://en.wikipedia.org/wiki/BMP_file_format
这篇关于位图文件的哪一部分是元数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!