why i write tiff file left and right reversed

I use tifflib LibTIFF TIFF Library
My GL effect anticlockwise ,but render tiff file is widdershins.I render tga file is well!
Any suggestions? Thanks in advance.

code:

glReadBuffer(GL_BACK);
glReadPixels(0, 0, _width, _height, GL_RGBA, GL_UNSIGNED_BYTE, data);

TIFFWriteEncodedStrip(tif, 0, raster, _width * _height *4);

Maybe the TIFF library coordinates are different from OpenGL’s. OpenGL texture coordinates have their origin at the bottom left of the image. The majority of the image file formats have their origin at upper left corner of the image. You can solve this by yourself moving the pixels of the image or scaling the OpenGL texture transformation matrix by a factor of -1 in the X axis.

yourself moving the pixels of the image[/QB]
Thanks Azdo! suggest very useful!