2002.02.01 01:20 "tiff (libtiff)", by spin soft

2002.02.01 06:13 "Re: tiff (libtiff)", by Peter Montgomery

Spin Soft,

I want to use libtiff to create an tiff file from bmp, who can give me an example, I don't know how to do, thanks very much!!

It seems to be a simple question, but it requires a pretty broad response. The TIFF library is designed simply to read and write TIFF files - anything else is up to you. Thus, to convert the file you need to write a lot of code that will be able to read a BMP file, store it in memory in a format that is compatible with the TIFF library, and then use the TIFF library to save the image.

All of this is complicated by the fact that there are numerous varieties of both BMP and TIFF files. Your BMP code will have to handle 4 bit, 8 bit, and 24 bit BMP images. In addition, BMP files are stored BGR, so prior to handing the data to the TIFF library, you'll need to convert it to RGB.

Basically, there's a lot of work involved in this. Perhaps someone on the list has a pre-existing project to do image file conversions, but it's not something you can just put together quickly as an example.

Thanks,
PeterM