1
Index: digikam/utilities/imageeditor/imlibinterface.cpp
2
===================================================================
3
--- digikam/utilities/imageeditor/imlibinterface.cpp (revision 507544)
4
+++ digikam/utilities/imageeditor/imlibinterface.cpp (revision 507591)
9
+#include <kfilemetainfo.h>
12
#include <libkexif/kexifdata.h>
17
-class ImlibInterfacePrivate {
18
+class ImlibInterfacePrivate
25
int ImlibInterface::fileFormat(const QString& filePath)
27
+ if ( filePath == QString::null )
30
FILE* f = fopen(QFile::encodeName(filePath), "rb");
34
kdWarning() << "Failed to open file" << endl;
39
- DcrawParse rawFileParser;
40
- unsigned short jpegID = 0xD8FF;
41
- unsigned short tiffBigID = 0x4d4d;
42
- unsigned short tiffLilID = 0x4949;
43
- unsigned char pngID[8] = {'\211', 'P', 'N', 'G', '\r', '\n', '\032', '\n'};
45
+ DcrawParse rawFileParser;
46
+ uchar jpegID[2] = { 0xFF, 0xD8 };
47
+ uchar tiffBigID[2] = { 0x4D, 0x4D };
48
+ uchar tiffLilID[2] = { 0x49, 0x49 };
49
+ uchar pngID[8] = {'\211', 'P', 'N', 'G', '\r', '\n', '\032', '\n'};
51
if (memcmp(&header, &jpegID, 2) == 0) // JPEG file ?
59
+ // In others cases, QImage will be used to try to open file.
60
+ return QIMAGE_IMAGE;
62
- // In others cases, QImage will be used to open file.
63
- return QIMAGE_IMAGE;
66
bool ImlibInterface::load(const QString& filename, bool *isReadOnly)