2 * QImageIO Routines to read/write g3 (fax) images.
3 * copyright (c) 2000, Matthias Hölzer-Klüpfel <hoelzer@kde.org>
5 * This library is distributed under the conditions of the GNU LGPL.
17 KDE_EXPORT
void kimgio_g3_read( QImageIO
*io
)
19 // This won't work if io is not a QFile !
20 TIFF
*tiff
= TIFFOpen(QFile::encodeName(io
->fileName()), "r");
27 if( TIFFGetField( tiff
, TIFFTAG_IMAGEWIDTH
, &width
) != 1
28 || TIFFGetField( tiff
, TIFFTAG_IMAGELENGTH
, &height
) != 1 )
30 scanlength
= TIFFScanlineSize(tiff
);
32 QImage
image(width
, height
, 1, 0, QImage::BigEndian
);
34 if (image
.isNull() || scanlength
!= image
.bytesPerLine())
40 for (uint32 y
=0; y
< height
; y
++)
41 TIFFReadScanline(tiff
, image
.scanLine(y
), y
);
50 KDE_EXPORT
void kimgio_g3_write(QImageIO
*)