开发者

Detecting Incorrect ImageLength in Tiff Tag

I f开发者_StackOverflowound out that tiff documents may have incorrect ImageLength tiff tag. Most of the viewers detect this and show the image in its correct length, but I want to do it programmatically. Is there any library that can help me? (In any language)


The short answer to this is that in order to find the "real" ImageLength, you have to decode the image and see what happens.

In theory, you can multiply the RowsPerStrip tag and multiply that by the number of rows which will get you a length that the image can't exceed, but if the last strip is fewer than the row per strip, you need to decode the last row to find out for sure. For tiles, you can do something similar.

This, of course, only applies if the image is stripped or tiled.

Otherwise, to find out, you have to decode.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜