Convert Tiff data type in libTiff to nsdata ios

笑着哭i 提交于 2019-12-11 03:16:00

问题


I am using libtiff to create tif images. Can any one help how to convert TIFF back to nsdata.

Thanks


回答1:


Conveniently, CFData is toll-free bridged with NSData, so you can basically turn it directly into an NSData object without doing anything. Just replace the line

CFRelease(pixelData);

With

NSData *tiffData = CFBridgingRelease(pixelData);

And that's your tiffData as an autoreleased NSData object, ready to use as you wish.




回答2:


Thanks for help by the community.

I figured out the answer. Just use the same function. that's it. It did not flash to me until now.



来源:https://stackoverflow.com/questions/9233282/convert-tiff-data-type-in-libtiff-to-nsdata-ios

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!