Tag: tiff

如何在c中读取TIFF文件头?

我如何在c中读取tiff文件头? 实际上我想学习TIFF Tag ImageWidth和TIFF Tag ImageLength。 我怎样才能访问这个属性? http://www.awaresystems.be/imaging/tiff/tifftags/imagewidth.html http://www.awaresystems.be/imaging/tiff/tifftags/imagelength.html 这段代码的c翻译可以帮助我: https://stackoverflow.com/a/9071933/2079158 我不知道, 试过这样的事情: #include “stdio.h” #include “stdlib.h” main() { FILE* f = fopen(“tifo.tif”, “rb”); unsigned char info[500]; fread(info, sizeof(unsigned char), 500, f); long int width = *(long int*)&info[256]; short int height = *(short int*)&info[257]; printf(“width : %d \n”, width); printf(“height : %d \n”, height); fclose(f); […]

fseek到32位无符号偏移量

我正在读取一个文件格式(TIFF),它从文件的开头有32位无符号偏移量。 不幸的是fseek的原型,通常我会去特定的文件偏移,是: int fseek ( FILE * stream, long int offset, int origin ); 所以偏移是签名的。 我应该如何处理这种情况? 我应该使用不同的function进行搜索吗?