[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kdelibs/frameworks] kimgio: Make kimgio not use kdecore
From: Albert Astals Cid <tsdgeos () terra ! es>
Date: 2012-12-29 15:57:06
Message-ID: 20121229155706.F0CD0A6091 () git ! kde ! org
[Download RAW message or body]
Git commit 39967a5b9e974cf7d5e50a6d7e67875857671ba4 by Albert Astals Cid.
Committed on 29/12/2012 at 16:55.
Pushed by aacid into branch 'frameworks'.
Make kimgio not use kdecore
REVIEW: 107986
M +12 -12 kimgio/CMakeLists.txt
M +4 -5 kimgio/dds.cpp
M +22 -22 kimgio/eps.cpp
M +2 -4 kimgio/exr.cpp
M +22 -23 kimgio/pcx.cpp
M +4 -5 kimgio/psd.cpp
M +4 -5 kimgio/ras.cpp
M +28 -27 kimgio/rgb.cpp
M +6 -7 kimgio/tga.cpp
M +27 -26 kimgio/xcf.cpp
http://commits.kde.org/kdelibs/39967a5b9e974cf7d5e50a6d7e67875857671ba4
diff --git a/kimgio/CMakeLists.txt b/kimgio/CMakeLists.txt
index 84e0d6f..ec49b15 100644
--- a/kimgio/CMakeLists.txt
+++ b/kimgio/CMakeLists.txt
@@ -18,7 +18,7 @@ if(JASPER_FOUND)
include_directories( ${JASPER_INCLUDE_DIR} )
set(kimg_jp2_LIB_SRCS jp2.cpp)
kde4_add_plugin(kimg_jp2 ${kimg_jp2_LIB_SRCS})
- target_link_libraries(kimg_jp2 ${KDE4_KDECORE_LIBS} ${QT_QTGUI_LIBRARY} ${JASPER_LIBRARIES} )
+ target_link_libraries(kimg_jp2 ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${JASPER_LIBRARIES} )
install(TARGETS kimg_jp2 DESTINATION ${QT_PLUGIN_INSTALL_DIR}/imageformats/ )
install( FILES jp2.desktop DESTINATION ${SERVICES_INSTALL_DIR}/qimageioplugins/ )
@@ -30,7 +30,7 @@ macro_log_feature(JASPER_FOUND "JasPer" "Support for JPEG-2000 images" "http://w
set(kimg_eps_LIB_SRCS eps.cpp)
kde4_add_plugin(kimg_eps ${kimg_eps_LIB_SRCS})
-target_link_libraries(kimg_eps ${KDE4_KDECORE_LIBS} ${QT_QTGUI_LIBRARY})
+target_link_libraries(kimg_eps ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY})
install(TARGETS kimg_eps DESTINATION ${QT_PLUGIN_INSTALL_DIR}/imageformats/ )
@@ -38,7 +38,7 @@ install(TARGETS kimg_eps DESTINATION ${QT_PLUGIN_INSTALL_DIR}/imageformats/ )
set(kimg_pcx_LIB_SRCS pcx.cpp)
kde4_add_plugin(kimg_pcx ${kimg_pcx_LIB_SRCS})
-target_link_libraries(kimg_pcx ${KDE4_KDECORE_LIBS} ${QT_QTGUI_LIBRARY})
+target_link_libraries(kimg_pcx ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY})
install(TARGETS kimg_pcx DESTINATION ${QT_PLUGIN_INSTALL_DIR}/imageformats/ )
@@ -46,7 +46,7 @@ install(TARGETS kimg_pcx DESTINATION ${QT_PLUGIN_INSTALL_DIR}/imageformats/ )
set(kimg_tga_LIB_SRCS tga.cpp)
kde4_add_plugin(kimg_tga ${kimg_tga_LIB_SRCS})
-target_link_libraries(kimg_tga ${KDE4_KDECORE_LIBS} ${QT_QTGUI_LIBRARY})
+target_link_libraries(kimg_tga ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY})
install(TARGETS kimg_tga DESTINATION ${QT_PLUGIN_INSTALL_DIR}/imageformats/ )
@@ -54,7 +54,7 @@ install(TARGETS kimg_tga DESTINATION ${QT_PLUGIN_INSTALL_DIR}/imageformats/ )
set(kimg_ras_LIB_SRCS ras.cpp)
kde4_add_plugin(kimg_ras ${kimg_ras_LIB_SRCS})
-target_link_libraries(kimg_ras ${KDE4_KDECORE_LIBS} ${QT_QTGUI_LIBRARY})
+target_link_libraries(kimg_ras ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY})
install(TARGETS kimg_ras DESTINATION ${QT_PLUGIN_INSTALL_DIR}/imageformats/ )
@@ -62,7 +62,7 @@ install(TARGETS kimg_ras DESTINATION ${QT_PLUGIN_INSTALL_DIR}/imageformats/ )
set(kimg_rgb_LIB_SRCS rgb.cpp)
kde4_add_plugin(kimg_rgb ${kimg_rgb_LIB_SRCS})
-target_link_libraries(kimg_rgb ${KDE4_KDECORE_LIBS} ${QT_QTGUI_LIBRARY})
+target_link_libraries(kimg_rgb ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY})
install(TARGETS kimg_rgb DESTINATION ${QT_PLUGIN_INSTALL_DIR}/imageformats/ )
@@ -70,7 +70,7 @@ install(TARGETS kimg_rgb DESTINATION ${QT_PLUGIN_INSTALL_DIR}/imageformats/ )
set(kimg_xcf_LIB_SRCS xcf.cpp)
kde4_add_plugin(kimg_xcf ${kimg_xcf_LIB_SRCS})
-target_link_libraries(kimg_xcf ${KDE4_KDECORE_LIBS} ${QT_QTGUI_LIBRARY})
+target_link_libraries(kimg_xcf ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY})
install(TARGETS kimg_xcf DESTINATION ${QT_PLUGIN_INSTALL_DIR}/imageformats/ )
@@ -79,7 +79,7 @@ install(TARGETS kimg_xcf DESTINATION ${QT_PLUGIN_INSTALL_DIR}/imageformats/ )
set(kimg_dds_LIB_SRCS dds.cpp)
kde4_add_plugin(kimg_dds ${kimg_dds_LIB_SRCS})
-target_link_libraries(kimg_dds ${KDE4_KDECORE_LIBS} ${QT_QTGUI_LIBRARY})
+target_link_libraries(kimg_dds ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY})
install(TARGETS kimg_dds DESTINATION ${QT_PLUGIN_INSTALL_DIR}/imageformats/ )
@@ -88,7 +88,7 @@ install(TARGETS kimg_dds DESTINATION ${QT_PLUGIN_INSTALL_DIR}/imageformats/ )
set(kimg_psd_LIB_SRCS psd.cpp)
kde4_add_plugin(kimg_psd ${kimg_psd_LIB_SRCS})
-target_link_libraries(kimg_psd ${KDE4_KDECORE_LIBS} ${QT_QTGUI_LIBRARY})
+target_link_libraries(kimg_psd ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY})
install(TARGETS kimg_psd DESTINATION ${QT_PLUGIN_INSTALL_DIR}/imageformats/ )
@@ -96,7 +96,7 @@ install(TARGETS kimg_psd DESTINATION ${QT_PLUGIN_INSTALL_DIR}/imageformats/ )
set(kimg_xview_LIB_SRCS xview.cpp)
kde4_add_plugin(kimg_xview ${kimg_xview_LIB_SRCS})
-target_link_libraries(kimg_xview ${KDE4_KDECORE_LIBS} ${QT_QTGUI_LIBRARY})
+target_link_libraries(kimg_xview ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY})
install(TARGETS kimg_xview DESTINATION ${QT_PLUGIN_INSTALL_DIR}/imageformats/ )
@@ -107,7 +107,7 @@ if(OPENEXR_FOUND)
add_definitions(${OPENEXR_DEFINITIONS})
set(kimg_exr_LIB_SRCS exr.cpp)
kde4_add_plugin(kimg_exr ${kimg_exr_LIB_SRCS})
- target_link_libraries(kimg_exr ${KDE4_KDECORE_LIBS} ${QT_QTGUI_LIBRARY} ${OPENEXR_LIBRARIES} )
+ target_link_libraries(kimg_exr ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${OPENEXR_LIBRARIES} )
install(TARGETS kimg_exr DESTINATION ${QT_PLUGIN_INSTALL_DIR}/imageformats/ )
install( FILES exr.desktop DESTINATION ${SERVICES_INSTALL_DIR}/qimageioplugins/ )
@@ -118,7 +118,7 @@ macro_log_feature(OPENEXR_FOUND "OpenEXR" "Support for OpenEXR images" "http://w
set(kimg_pic_LIB_SRCS pic_read.cpp pic_write.cpp pic_io_plugin.cpp pic_io_handler.cpp)
kde4_add_plugin(kimg_pic ${kimg_pic_LIB_SRCS})
-target_link_libraries(kimg_pic ${KDE4_KDECORE_LIBS} ${QT_QTGUI_LIBRARY})
+target_link_libraries(kimg_pic ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY})
install(TARGETS kimg_pic DESTINATION ${QT_PLUGIN_INSTALL_DIR}/imageformats/ )
diff --git a/kimgio/dds.cpp b/kimgio/dds.cpp
index ff773e7..0090703 100644
--- a/kimgio/dds.cpp
+++ b/kimgio/dds.cpp
@@ -24,8 +24,7 @@
#include <QtCore/QStringList>
#include <QImage>
#include <QtCore/QDataStream>
-
-#include <kdebug.h>
+// #include <QDebug>
#include <math.h> // sqrtf
@@ -961,7 +960,7 @@ bool DDSHandler::read(QImage *image)
uint fourcc;
s >> fourcc;
if( fourcc != FOURCC_DDS ) {
- kDebug(399) << "This is not a DDS file.";
+// qDebug() << "This is not a DDS file.";
return false;
}
@@ -971,13 +970,13 @@ bool DDSHandler::read(QImage *image)
// Check image file format.
if( s.atEnd() || !IsValid( header ) ) {
- kDebug(399) << "This DDS file is not valid.";
+// qDebug() << "This DDS file is not valid.";
return false;
}
// Determine image type, by now, we only support 2d textures.
if( !IsSupported( header ) ) {
- kDebug(399) << "This DDS file is not supported.";
+// qDebug() << "This DDS file is not supported.";
return false;
}
diff --git a/kimgio/eps.cpp b/kimgio/eps.cpp
index b96a1b3..f7938fc 100644
--- a/kimgio/eps.cpp
+++ b/kimgio/eps.cpp
@@ -14,7 +14,7 @@
#include <QPrinter>
#include <QtCore/QTextStream>
#include <QtCore/QTemporaryFile>
-#include <kdebug.h>
+// #include <QDebug>
#define BUFLEN 200
@@ -29,26 +29,26 @@ static bool seekToCodeStart( QIODevice * io, quint32 & ps_offset, quint32 & ps_s
if ( io->read(buf, 2)!=2 ) // Read first two bytes
{
- kError(399) << "kimgio EPS: EPS file has less than 2 bytes." << endl;
+// qDebug() << "kimgio EPS: EPS file has less than 2 bytes." << endl;
return false;
}
if ( buf[0]=='%' && buf[1]=='!' ) // Check %! magic
{
- kDebug(399) << "kimgio EPS: normal EPS file";
+// qDebug() << "kimgio EPS: normal EPS file";
}
else if ( buf[0]==char(0xc5) && buf[1]==char(0xd0) ) // Check start of MS-DOS EPS magic
{ // May be a MS-DOS EPS file
if ( io->read(buf+2, 2)!=2 ) // Read further bytes of MS-DOS EPS magic
{
- kError(399) << "kimgio EPS: potential MS-DOS EPS file has less than 4 bytes." << endl;
+// qDebug() << "kimgio EPS: potential MS-DOS EPS file has less than 4 bytes." << endl;
return false;
}
if ( buf[2]==char(0xd3) && buf[3]==char(0xc6) ) // Check last bytes of MS-DOS EPS magic
{
if (io->read(buf, 4)!=4) // Get offset of PostScript code in the MS-DOS EPS file.
{
- kError(399) << "kimgio EPS: cannot read offset of MS-DOS EPS file" << endl;
+// qDebug() << "kimgio EPS: cannot read offset of MS-DOS EPS file" << endl;
return false;
}
ps_offset // Offset is in little endian
@@ -58,7 +58,7 @@ static bool seekToCodeStart( QIODevice * io, quint32 & ps_offset, quint32 & ps_s
+ ((unsigned char) buf[3] << 24);
if (io->read(buf, 4)!=4) // Get size of PostScript code in the MS-DOS EPS file.
{
- kError(399) << "kimgio EPS: cannot read size of MS-DOS EPS file" << endl;
+// qDebug() << "kimgio EPS: cannot read size of MS-DOS EPS file" << endl;
return false;
}
ps_size // Size is in little endian
@@ -66,36 +66,36 @@ static bool seekToCodeStart( QIODevice * io, quint32 & ps_offset, quint32 & ps_s
+ ((unsigned char) buf[1] << 8)
+ ((unsigned char) buf[2] << 16)
+ ((unsigned char) buf[3] << 24);
- kDebug(399) << "kimgio EPS: Offset: " << ps_offset <<" Size: " << ps_size;
+// qDebug() << "kimgio EPS: Offset: " << ps_offset <<" Size: " << ps_size;
if ( !io->seek(ps_offset) ) // Get offset of PostScript code in the MS-DOS EPS file.
{
- kError(399) << "kimgio EPS: cannot seek in MS-DOS EPS file" << endl;
+// qDebug() << "kimgio EPS: cannot seek in MS-DOS EPS file" << endl;
return false;
}
if ( io->read(buf, 2)!=2 ) // Read first two bytes of what should be the Postscript code
{
- kError(399) << "kimgio EPS: PostScript code has less than 2 bytes." << endl;
+// qDebug() << "kimgio EPS: PostScript code has less than 2 bytes." << endl;
return false;
}
if ( buf[0]=='%' && buf[1]=='!' ) // Check %! magic
{
- kDebug(399) << "kimgio EPS: MS-DOS EPS file";
+// qDebug() << "kimgio EPS: MS-DOS EPS file";
}
else
{
- kError(399) << "kimgio EPS: supposed Postscript code of a MS-DOS EPS file doe not start with %!." << endl;
+// qDebug() << "kimgio EPS: supposed Postscript code of a MS-DOS EPS file doe not start with %!." << endl;
return false;
}
}
else
{
- kError(399) << "kimgio EPS: wrong magic for potential MS-DOS EPS file!" << endl;
+// qDebug() << "kimgio EPS: wrong magic for potential MS-DOS EPS file!" << endl;
return false;
}
}
else
{
- kError(399) << "kimgio EPS: not an EPS file!" << endl;
+// qDebug() << "kimgio EPS: not an EPS file!" << endl;
return false;
}
return true;
@@ -116,7 +116,7 @@ static bool bbox ( QIODevice *io, int *x1, int *y1, int *x2, int *y2)
float _x1, _y1, _x2, _y2;
if ( sscanf (buf, "%*s %f %f %f %f",
&_x1, &_y1, &_x2, &_y2) == 4) {
- kDebug(399) << "kimgio EPS BBOX: " << _x1 << " " << _y1 << " " << _x2 << " " << _y2;
+// qDebug() << "kimgio EPS BBOX: " << _x1 << " " << _y1 << " " << _x2 << " " << _y2;
*x1=(int)_x1; *y1=(int)_y1; *x2=(int)_x2; *y2=(int)_y2;
ret = true;
break;
@@ -142,7 +142,7 @@ bool EPSHandler::canRead() const
bool EPSHandler::read(QImage *image)
{
- kDebug(399) << "kimgio EPS: starting...";
+// qDebug() << "kimgio EPS: starting...";
FILE * ghostfd;
int x1, y1, x2, y2;
@@ -161,13 +161,13 @@ bool EPSHandler::read(QImage *image)
// find bounding box
if ( !bbox (io, &x1, &y1, &x2, &y2)) {
- kError(399) << "kimgio EPS: no bounding box found!" << endl;
+// qDebug() << "kimgio EPS: no bounding box found!" << endl;
return false;
}
QTemporaryFile tmpFile;
if( !tmpFile.open() ) {
- kError(399) << "kimgio EPS: no temp file!" << endl;
+// qDebug() << "kimgio EPS: no temp file!" << endl;
return false;
}
@@ -176,7 +176,7 @@ bool EPSHandler::read(QImage *image)
x2 -= x1;
y2 -= y1;
- //kDebug(399) << "origin point: " << x1 << "," << y1 << " size:" << x2 << "," << y2;
+ //qDebug() << "origin point: " << x1 << "," << y1 << " size:" << x2 << "," << y2;
double xScale = 1.0;
double yScale = 1.0;
int wantedWidth = x2;
@@ -205,7 +205,7 @@ bool EPSHandler::read(QImage *image)
ghostfd = popen (QFile::encodeName(cmdBuf), "w");
if ( ghostfd == 0 ) {
- kError(399) << "kimgio EPS: no GhostScript?" << endl;
+// qDebug() << "kimgio EPS: no GhostScript?" << endl;
return false;
}
@@ -229,12 +229,12 @@ bool EPSHandler::read(QImage *image)
// load image
if( image->load (tmpFile.fileName()) ) {
- kDebug(399) << "kimgio EPS: success!";
- //kDebug(399) << "Loading EPS took " << (float)(dt.elapsed()) / 1000 << " seconds";
+// qDebug() << "kimgio EPS: success!";
+ //qDebug() << "Loading EPS took " << (float)(dt.elapsed()) / 1000 << " seconds";
return true;
}
- kError(399) << "kimgio EPS: no image!" << endl;
+// qDebug() << "kimgio EPS: no image!" << endl;
return false;
}
diff --git a/kimgio/exr.cpp b/kimgio/exr.cpp
index 3322343..7361ac4 100644
--- a/kimgio/exr.cpp
+++ b/kimgio/exr.cpp
@@ -29,11 +29,9 @@
#include <iostream>
-#include <kdebug.h>
-
-
#include <QImage>
#include <QDataStream>
+// #include <QDebug>
#include <QImageIOPlugin>
class K_IStream: public Imf::IStream
@@ -200,7 +198,7 @@ bool EXRHandler::read( QImage *outImage )
}
catch (const std::exception &exc)
{
- kDebug() << exc.what();
+// qDebug() << exc.what();
return false;
}
}
diff --git a/kimgio/pcx.cpp b/kimgio/pcx.cpp
index f4825c5..4237966 100644
--- a/kimgio/pcx.cpp
+++ b/kimgio/pcx.cpp
@@ -9,10 +9,9 @@
#include "pcx.h"
+// #include <QDebug>
#include <QImage>
-#include <kdebug.h>
-
static QDataStream &operator>>( QDataStream &s, RGB &rgb )
{
quint8 r, g, b;
@@ -242,7 +241,7 @@ static void readImage8( QImage &img, QDataStream &s, const PCXHEADER &header )
quint8 flag;
s >> flag;
- kDebug( 399 ) << "Palette Flag: " << flag;
+// qDebug() << "Palette Flag: " << flag;
if ( flag == 12 && ( header.Version == 5 || header.Version == 2 ) )
{
@@ -464,19 +463,19 @@ bool PCXHandler::read(QImage *outImage)
return false;
}
- int w = header.width();
- int h = header.height();
+// int w = header.width();
+// int h = header.height();
- kDebug( 399 ) << "Manufacturer: " << header.Manufacturer;
- kDebug( 399 ) << "Version: " << header.Version;
- kDebug( 399 ) << "Encoding: " << header.Encoding;
- kDebug( 399 ) << "Bpp: " << header.Bpp;
- kDebug( 399 ) << "Width: " << w;
- kDebug( 399 ) << "Height: " << h;
- kDebug( 399 ) << "Window: " << header.XMin << "," << header.XMax << ","
- << header.YMin << "," << header.YMax << endl;
- kDebug( 399 ) << "BytesPerLine: " << header.BytesPerLine;
- kDebug( 399 ) << "NPlanes: " << header.NPlanes;
+// qDebug() << "Manufacturer: " << header.Manufacturer;
+// qDebug() << "Version: " << header.Version;
+// qDebug() << "Encoding: " << header.Encoding;
+// qDebug() << "Bpp: " << header.Bpp;
+// qDebug() << "Width: " << w;
+// qDebug() << "Height: " << h;
+// qDebug() << "Window: " << header.XMin << "," << header.XMax << ","
+// << header.YMin << "," << header.YMax << endl;
+// qDebug() << "BytesPerLine: " << header.BytesPerLine;
+// qDebug() << "NPlanes: " << header.NPlanes;
QImage img;
@@ -497,9 +496,9 @@ bool PCXHandler::read(QImage *outImage)
readImage24( img, s, header );
}
- kDebug( 399 ) << "Image Bytes: " << img.numBytes();
- kDebug( 399 ) << "Image Bytes Per Line: " << img.bytesPerLine();
- kDebug( 399 ) << "Image Depth: " << img.depth();
+// qDebug() << "Image Bytes: " << img.numBytes();
+// qDebug() << "Image Bytes Per Line: " << img.bytesPerLine();
+// qDebug() << "Image Depth: " << img.depth();
if ( !img.isNull() )
{
@@ -522,11 +521,11 @@ bool PCXHandler::write(const QImage &image)
int w = img.width();
int h = img.height();
- kDebug( 399 ) << "Width: " << w;
- kDebug( 399 ) << "Height: " << h;
- kDebug( 399 ) << "Depth: " << img.depth();
- kDebug( 399 ) << "BytesPerLine: " << img.bytesPerLine();
- kDebug( 399 ) << "Num Colors: " << img.numColors();
+// qDebug() << "Width: " << w;
+// qDebug() << "Height: " << h;
+// qDebug() << "Depth: " << img.depth();
+// qDebug() << "BytesPerLine: " << img.bytesPerLine();
+// qDebug() << "Num Colors: " << img.numColors();
PCXHEADER header;
diff --git a/kimgio/psd.cpp b/kimgio/psd.cpp
index dd4e5c2..52dcebf 100644
--- a/kimgio/psd.cpp
+++ b/kimgio/psd.cpp
@@ -21,8 +21,7 @@
#include <QImage>
#include <QtCore/QDataStream>
-
-#include <kdebug.h>
+// #include <QDebug>
typedef quint32 uint;
typedef quint16 ushort;
@@ -259,19 +258,19 @@ bool PSDHandler::read(QImage *image)
// Check image file format.
if( s.atEnd() || !IsValid( header ) ) {
- kDebug(399) << "This PSD file is not valid.";
+// qDebug() << "This PSD file is not valid.";
return false;
}
// Check if it's a supported format.
if( !IsSupported( header ) ) {
- kDebug(399) << "This PSD file is not supported.";
+// qDebug() << "This PSD file is not supported.";
return false;
}
QImage img;
if( !LoadPSD(s, header, img) ) {
- kDebug(399) << "Error loading PSD file.";
+// qDebug() << "Error loading PSD file.";
return false;
}
diff --git a/kimgio/ras.cpp b/kimgio/ras.cpp
index 1abbd2c..f056c54 100644
--- a/kimgio/ras.cpp
+++ b/kimgio/ras.cpp
@@ -13,8 +13,7 @@
#include <QImage>
#include <QtCore/QDataStream>
-
-#include <kdebug.h>
+// #include <QDebug>
namespace { // Private.
// format info from http://www.fileformat.info/format/sunraster/egff.htm
@@ -256,13 +255,13 @@ bool RASHandler::read(QImage *outImage)
// Check image file format. Type 2 is RLE, which causing seeking to be silly.
if( !s.atEnd() && ras.Type != 2) {
- kDebug(399) << "This RAS file is not valid, or an older version of the format.";
+// qDebug() << "This RAS file is not valid, or an older version of the format.";
return false;
}
// Check supported file types.
if( !IsSupported(ras) ) {
- kDebug(399) << "This RAS file is not supported.";
+// qDebug() << "This RAS file is not supported.";
return false;
}
@@ -270,7 +269,7 @@ bool RASHandler::read(QImage *outImage)
bool result = LoadRAS(s, ras, img);
if( result == false ) {
- kDebug(399) << "Error loading RAS file.";
+// qDebug() << "Error loading RAS file.";
return false;
}
diff --git a/kimgio/rgb.cpp b/kimgio/rgb.cpp
index a04e1cf..49b500f 100644
--- a/kimgio/rgb.cpp
+++ b/kimgio/rgb.cpp
@@ -25,7 +25,7 @@
#include "rgb.h"
#include <QImage>
-#include <kdebug.h>
+// #include <QDebug>
SGIImage::SGIImage(QIODevice *io) :
@@ -152,7 +152,7 @@ bool SGIImage::readImage(QImage& img)
qint16 u16;
qint32 u32;
- kDebug(399) << "reading rgb ";
+// qDebug() << "reading rgb ";
// magic
_stream >> u16;
@@ -161,37 +161,37 @@ bool SGIImage::readImage(QImage& img)
// verbatim/rle
_stream >> _rle;
- kDebug(399) << (_rle ? "RLE" : "verbatim");
+// qDebug() << (_rle ? "RLE" : "verbatim");
if (_rle > 1)
return false;
// bytes per channel
_stream >> _bpc;
- kDebug(399) << "bytes per channel: " << int(_bpc);
+// qDebug() << "bytes per channel: " << int(_bpc);
if (_bpc == 1)
;
- else if (_bpc == 2)
- kDebug(399) << "dropping least significant byte";
- else
+ else if (_bpc == 2) {
+// qDebug() << "dropping least significant byte";
+ } else
return false;
// number of dimensions
_stream >> _dim;
- kDebug(399) << "dimensions: " << _dim;
+// qDebug() << "dimensions: " << _dim;
if (_dim < 1 || _dim > 3)
return false;
_stream >> _xsize >> _ysize >> _zsize >> _pixmin >> _pixmax >> u32;
- kDebug(399) << "x: " << _xsize;
- kDebug(399) << "y: " << _ysize;
- kDebug(399) << "z: " << _zsize;
+// qDebug() << "x: " << _xsize;
+// qDebug() << "y: " << _ysize;
+// qDebug() << "z: " << _zsize;
// name
_stream.readRawData(_imagename, 80);
_imagename[79] = '\0';
_stream >> _colormap;
- kDebug(399) << "colormap: " << _colormap;
+// qDebug() << "colormap: " << _colormap;
if (_colormap != NORMAL)
return false; // only NORMAL supported
@@ -199,7 +199,7 @@ bool SGIImage::readImage(QImage& img)
_stream >> u8;
if (_dim == 1) {
- kDebug(399) << "1-dimensional images aren't supported yet";
+// qDebug() << "1-dimensional images aren't supported yet";
return false;
}
@@ -212,8 +212,9 @@ bool SGIImage::readImage(QImage& img)
if (_zsize == 2 || _zsize == 4)
img = img.convertToFormat(QImage::Format_ARGB32);
- else if (_zsize > 4)
- kDebug(399) << "using first 4 of " << _zsize << " channels";
+ else if (_zsize > 4) {
+// qDebug() << "using first 4 of " << _zsize << " channels";
+ }
if (_rle) {
uint l;
@@ -235,12 +236,12 @@ bool SGIImage::readImage(QImage& img)
for (uint o = 0; o < _numrows; o++)
// don't change to greater-or-equal!
if (_starttab[o] + _lengthtab[o] > (uint)_data.size()) {
- kDebug(399) << "image corrupt (sanity check failed)";
+// qDebug() << "image corrupt (sanity check failed)";
return false;
}
if (!readData(img)) {
- kDebug(399) << "image corrupt (incomplete scanline)";
+// qDebug() << "image corrupt (incomplete scanline)";
return false;
}
@@ -414,7 +415,7 @@ void SGIImage::writeHeader()
void SGIImage::writeRle()
{
_rle = 1;
- kDebug(399) << "writing RLE data";
+// qDebug() << "writing RLE data";
writeHeader();
uint i;
@@ -435,7 +436,7 @@ void SGIImage::writeRle()
void SGIImage::writeVerbatim(const QImage& img)
{
_rle = 0;
- kDebug(399) << "writing verbatim data";
+// qDebug() << "writing verbatim data";
writeHeader();
const QRgb *c;
@@ -477,7 +478,7 @@ void SGIImage::writeVerbatim(const QImage& img)
bool SGIImage::writeImage(const QImage& image)
{
- kDebug(399) << "writing "; // TODO add filename
+// qDebug() << "writing "; // TODO add filename
QImage img = image;
if (img.allGray())
_dim = 2, _zsize = 1;
@@ -489,7 +490,7 @@ bool SGIImage::writeImage(const QImage& image)
img = img.convertToFormat(QImage::Format_RGB32);
if (img.isNull()) {
- kDebug(399) << "can't convert image to depth 32";
+// qDebug() << "can't convert image to depth 32";
return false;
}
@@ -504,7 +505,7 @@ bool SGIImage::writeImage(const QImage& image)
_rlemap.setBaseOffset(512 + _numrows * 2 * sizeof(quint32));
if (!scanData(img)) {
- kDebug(399) << "this can't happen";
+// qDebug() << "this can't happen";
return false;
}
@@ -515,11 +516,11 @@ bool SGIImage::writeImage(const QImage& image)
for (int i = 0; i < _rlevector.size(); i++)
rle_size += _rlevector[i]->size();
- kDebug(399) << "minimum intensity: " << _pixmin;
- kDebug(399) << "maximum intensity: " << _pixmax;
- kDebug(399) << "saved scanlines: " << _numrows - _rlemap.size();
- kDebug(399) << "total savings: " << (verbatim_size - rle_size) << " bytes";
- kDebug(399) << "compression: " << (rle_size * 100.0 / verbatim_size) << '%';
+// qDebug() << "minimum intensity: " << _pixmin;
+// qDebug() << "maximum intensity: " << _pixmax;
+// qDebug() << "saved scanlines: " << _numrows - _rlemap.size();
+// qDebug() << "total savings: " << (verbatim_size - rle_size) << " bytes";
+// qDebug() << "compression: " << (rle_size * 100.0 / verbatim_size) << '%';
if (verbatim_size <= rle_size)
writeVerbatim(img);
diff --git a/kimgio/tga.cpp b/kimgio/tga.cpp
index 4ab352b..c6f1599 100644
--- a/kimgio/tga.cpp
+++ b/kimgio/tga.cpp
@@ -24,8 +24,7 @@
#include <QImage>
#include <QtCore/QDataStream>
-
-#include <kdebug.h>
+// #include <QDebug>
typedef quint32 uint;
typedef quint16 ushort;
@@ -199,7 +198,7 @@ namespace { // Private.
if (size < 1)
{
- kDebug(399) << "This TGA file is broken with size " << size;
+// qDebug() << "This TGA file is broken with size " << size;
return false;
}
@@ -331,7 +330,7 @@ bool TGAHandler::canRead() const
bool TGAHandler::read(QImage *outImage)
{
- //kDebug(399) << "Loading TGA file!";
+ //qDebug() << "Loading TGA file!";
QDataStream s( device() );
s.setByteOrder( QDataStream::LittleEndian );
@@ -344,13 +343,13 @@ bool TGAHandler::read(QImage *outImage)
// Check image file format.
if( s.atEnd() ) {
- kDebug(399) << "This TGA file is not valid.";
+// qDebug() << "This TGA file is not valid.";
return false;
}
// Check supported file types.
if( !IsSupported(tga) ) {
- kDebug(399) << "This TGA file is not supported.";
+// qDebug() << "This TGA file is not supported.";
return false;
}
@@ -359,7 +358,7 @@ bool TGAHandler::read(QImage *outImage)
bool result = LoadTGA(s, tga, img);
if( result == false ) {
- kDebug(399) << "Error loading TGA file.";
+// qDebug() << "Error loading TGA file.";
return false;
}
diff --git a/kimgio/xcf.cpp b/kimgio/xcf.cpp
index 829d258..2b782be 100644
--- a/kimgio/xcf.cpp
+++ b/kimgio/xcf.cpp
@@ -27,8 +27,7 @@
#include <QtCore/QIODevice>
#include <QtCore/QStack>
#include <QtCore/QVector>
-
-#include <kdebug.h>
+// #include <QDebug>
int XCFImageFormat::random_table[RANDOM_TABLE_SIZE];
@@ -110,17 +109,17 @@ bool XCFImageFormat::readXCF(QIODevice *device, QImage *outImage)
char tag[14];;
if (xcf_io.readRawData(tag, sizeof(tag)) != sizeof(tag)) {
- kDebug(399) << "XCF: read failure on header tag";
+// qDebug() << "XCF: read failure on header tag";
return false;
}
if (qstrncmp(tag, "gimp xcf", 8) != 0) {
- kDebug(399) << "XCF: read called on non-XCF file";
+// qDebug() << "XCF: read called on non-XCF file";
return false;
}
xcf_io >> xcf_image.width >> xcf_image.height >> xcf_image.type;
-kDebug() << tag << " " << xcf_image.width << " " << xcf_image.height << " " << xcf_image.type;
+// qDebug() << tag << " " << xcf_image.width << " " << xcf_image.height << " " << xcf_image.type;
if (!loadImageProperties(xcf_io, xcf_image))
return false;
@@ -146,8 +145,7 @@ kDebug() << tag << " " << xcf_image.width << " " << xcf_image.height << " " <<
xcf_image.num_layers = layer_offsets.size();
if (layer_offsets.size() == 0) {
- kDebug(399) << "XCF: no layers!";
- return false;
+// qDebug() << "XCF: no layers!"; return false;
}
// Load each layer and add it to the image
@@ -161,7 +159,7 @@ kDebug() << tag << " " << xcf_image.width << " " << xcf_image.height << " " <<
}
if (!xcf_image.initialized) {
- kDebug(399) << "XCF: no visible layers!";
+// qDebug() << "XCF: no visible layers!";
return false;
}
@@ -184,7 +182,7 @@ bool XCFImageFormat::loadImageProperties(QDataStream& xcf_io, XCFImage& xcf_imag
QByteArray bytes;
if (!loadProperty(xcf_io, type, bytes)) {
- kDebug(399) << "XCF: error loading global image properties";
+// qDebug() << "XCF: error loading global image properties";
return false;
}
@@ -250,8 +248,9 @@ bool XCFImageFormat::loadImageProperties(QDataStream& xcf_io, XCFImage& xcf_imag
break;
default:
- kDebug(399) << "XCF: unimplemented image property" << type
- << ", size " << bytes.size() << endl;
+// qDebug() << "XCF: unimplemented image property" << type
+// << ", size " << bytes.size() << endl;
+ break;
}
}
}
@@ -311,7 +310,7 @@ bool XCFImageFormat::loadProperty(QDataStream& xcf_io, PropType& type, QByteArra
delete[] unit_strings;
if (xcf_io.device()->atEnd()) {
- kDebug(399) << "XCF: read failure on property " << type;
+// qDebug() << "XCF: read failure on property " << type;
return false;
}
}
@@ -421,7 +420,7 @@ bool XCFImageFormat::loadLayerProperties(QDataStream& xcf_io, Layer& layer)
QByteArray bytes;
if (!loadProperty(xcf_io, type, bytes)) {
- kDebug(399) << "XCF: error loading layer properties";
+// qDebug() << "XCF: error loading layer properties";
return false;
}
@@ -476,8 +475,9 @@ bool XCFImageFormat::loadLayerProperties(QDataStream& xcf_io, Layer& layer)
break;
default:
- kDebug(399) << "XCF: unimplemented layer property " << type
- << ", size " << bytes.size() << endl;
+// qDebug() << "XCF: unimplemented layer property " << type
+// << ", size " << bytes.size() << endl;
+ break;
}
}
}
@@ -495,9 +495,9 @@ bool XCFImageFormat::composeTiles(XCFImage& xcf_image)
layer.nrows = (layer.height + TILE_HEIGHT - 1) / TILE_HEIGHT;
layer.ncols = (layer.width + TILE_WIDTH - 1) / TILE_WIDTH;
- //kDebug(399) << "IMAGE: height=" << xcf_image.height << ", width=" << xcf_image.width;
- //kDebug(399) << "LAYER: height=" << layer.height << ", width=" << layer.width;
- //kDebug(399) << "LAYER: rows=" << layer.nrows << ", columns=" << layer.ncols;
+ //qDebug() << "IMAGE: height=" << xcf_image.height << ", width=" << xcf_image.width;
+ //qDebug() << "LAYER: height=" << layer.height << ", width=" << layer.width;
+ //qDebug() << "LAYER: rows=" << layer.nrows << ", columns=" << layer.ncols;
// SANITY CHECK: Catch corrupted XCF image file where the width or height
// of a tile is reported are bogus. See Bug# 234030.
@@ -737,7 +737,7 @@ bool XCFImageFormat::loadHierarchy(QDataStream& xcf_io, Layer& layer)
xcf_io >> junk;
if (xcf_io.device()->atEnd()) {
- kDebug(399) << "XCF: read failure on layer " << layer.name << " level offsets";
+// qDebug() << "XCF: read failure on layer " << layer.name << " level offsets";
return false;
}
} while (junk != 0);
@@ -776,7 +776,7 @@ bool XCFImageFormat::loadLevel(QDataStream& xcf_io, Layer& layer, qint32 bpp)
for (uint i = 0; i < layer.ncols; i++) {
if (offset == 0) {
- kDebug(399) << "XCF: incorrect number of tiles in layer " << layer.name;
+// qDebug() << "XCF: incorrect number of tiles in layer " << layer.name;
return false;
}
@@ -875,7 +875,7 @@ bool XCFImageFormat::loadTileRLE(QDataStream& xcf_io, uchar* tile, int image_siz
uchar* xcfdatalimit;
if (data_length < 0 || data_length > int(TILE_WIDTH * TILE_HEIGHT * 4 * 1.5)) {
- kDebug(399) << "XCF: invalid tile data length" << data_length;
+// qDebug() << "XCF: invalid tile data length" << data_length;
return false;
}
@@ -885,7 +885,7 @@ bool XCFImageFormat::loadTileRLE(QDataStream& xcf_io, uchar* tile, int image_siz
if (!xcf_io.device()->isOpen()) {
delete[] xcfodata;
- kDebug(399) << "XCF: read failure on tile";
+// qDebug() << "XCF: read failure on tile";
return false;
}
@@ -963,7 +963,7 @@ bool XCFImageFormat::loadTileRLE(QDataStream& xcf_io, uchar* tile, int image_siz
bogus_rle:
- kDebug(399) << "The run length encoding could not be decoded properly";
+// qDebug() << "The run length encoding could not be decoded properly";
delete[] xcfodata;
return false;
}
@@ -983,7 +983,7 @@ bool XCFImageFormat::loadChannelProperties(QDataStream& xcf_io, Layer& layer)
QByteArray bytes;
if (!loadProperty(xcf_io, type, bytes)) {
- kDebug(399) << "XCF: error loading channel properties";
+// qDebug() << "XCF: error loading channel properties";
return false;
}
@@ -1015,8 +1015,9 @@ bool XCFImageFormat::loadChannelProperties(QDataStream& xcf_io, Layer& layer)
break;
default:
- kDebug(399) << "XCF: unimplemented channel property " << type
- << ", size " << bytes.size() << endl;
+// qDebug() << "XCF: unimplemented channel property " << type
+// << ", size " << bytes.size() << endl;
+ break;
}
}
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic