问题
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