Tag: libtiff

如何在iOS上用libtiff编写1bpp tiff?

我试图用libtiff写一个UIImage作为tiff。 问题是,即使我把它写成每像素1位,当我期望更多的像100k或更less的东西时,文件仍然在2-5MB范围内出现。 这是我得到的。 – (void) convertUIImage:(UIImage *)uiImage toTiff:(NSString *)file withThreshold:(float)threshold { TIFF *tiff; if ((tiff = TIFFOpen([file UTF8String], "w")) == NULL) { [[[UIAlertView alloc] initWithTitle:@"Error" message:[NSString stringWithFormat:@"Unable to write to file %@.", file] delegate:nil cancelButtonTitle:nil otherButtonTitles:@"OK", nil] show]; return; } CGImageRef image = [uiImage CGImage]; CGDataProviderRef provider = CGImageGetDataProvider(image); CFDataRef pixelData = CGDataProviderCopyData(provider); unsigned char […]

如何为Xcode项目和iOS应用程序做libtiff?

我一直在寻找上下stackoverflow和谷歌正确的方式来编译和libtiff库添加到我在Xcode中的现有的iOS项目。 我到目前为止所做的: 编辑: 我决定遵循这个build议在stackoverflow后,我已经下载libtiff到我的Mac。 我使用的版本是3.9.6 ,并且像本教程及其关于SDK5的续集一样构build它。 在评论中,我发现了一个我可以适应的脚本 。 我已经添加了结果“依赖”文件夹到我的Xcode项目,几乎像rakmohbuild议。 不过,只要我#include tiffio.h就有链接错误: Undefined symbols for architecture armv7: "_inflateEnd", referenced from: _PixarLogCleanup in libtiff.a(tif_pixarlog.o) _ZIPSetupEncode in libtiff.a(tif_zip.o) . … some more… . ld: symbol(s) not found for architecture armv7 clang: error: linker command failed with exit code 1 (use -v to see invocation) 我也尝试了libtiff的最新版本,但是这并没有改变,所以我回到3.9.6,因为它与项目中的其他软件兼容。 然后我问了一个同事,他发现这是libz库缺失。 从日志文件中看到,在libtiff的编译过程中,它一定是在那里的,而且在我的Xcode项目中它仍然没有链接器。 而且! […]