~ubuntu-branches/ubuntu/edgy/digikam/edgy-proposed

« back to all changes in this revision

Viewing changes to debian/patches/10_kdesvn_r507591_fix_jpeg_on_ppc.diff

  • Committer: Bazaar Package Importer
  • Author(s): Achim Bohnet
  • Date: 2006-05-15 01:15:02 UTC
  • mfrom: (1.2.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20060515011502-kpyuz7766hpbuia8
Tags: 0.8.2~rc1-0ubuntu1
* sync with debian (UVF see #44102)
  0.8.2~rc1-0ubuntu1 is identical to debian's 0.8.1+0.8.2-rc1-1.
  Version was changed due to latest 0.8.1.ubuntu-0ubuntu1 upload.
  This version is unfortunately bigger than debian's 0.8.1+0.8.2-rc1-1
* Merge in ubuntu changelog

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Index: digikam/utilities/imageeditor/imlibinterface.cpp
2
 
===================================================================
3
 
--- digikam/utilities/imageeditor/imlibinterface.cpp    (revision 507544)
4
 
+++ digikam/utilities/imageeditor/imlibinterface.cpp    (revision 507591)
5
 
@@ -48,6 +48,7 @@
6
 
 
7
 
 // KDE includes.
8
 
 
9
 
+#include <kfilemetainfo.h>
10
 
 #include <kdebug.h>
11
 
 #include <kprocess.h>
12
 
 #include <libkexif/kexifdata.h>
13
 
@@ -69,7 +70,8 @@
14
 
 
15
 
 #define MaxRGB 255L
16
 
 
17
 
-class ImlibInterfacePrivate {
18
 
+class ImlibInterfacePrivate
19
 
+{
20
 
 
21
 
 public:
22
 
 
23
 
@@ -170,7 +172,11 @@
24
 
 
25
 
 int ImlibInterface::fileFormat(const QString& filePath)
26
 
 {
27
 
+    if ( filePath == QString::null )
28
 
+        return NONE_IMAGE;
29
 
+        
30
 
     FILE* f = fopen(QFile::encodeName(filePath), "rb");
31
 
+    
32
 
     if (!f)
33
 
     {
34
 
         kdWarning() << "Failed to open file" << endl;
35
 
@@ -189,12 +195,12 @@
36
 
 
37
 
     fclose(f);
38
 
     
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'};
44
 
-    
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'};
50
 
+
51
 
     if (memcmp(&header, &jpegID, 2) == 0)            // JPEG file ?
52
 
     {
53
 
         return JPEG_IMAGE;
54
 
@@ -215,9 +221,10 @@
55
 
     {
56
 
         return TIFF_IMAGE;
57
 
     }
58
 
+    
59
 
+    // In others cases, QImage will be used to try to open file.
60
 
+    return QIMAGE_IMAGE;
61
 
 
62
 
-    // In others cases, QImage will be used to open file.
63
 
-    return QIMAGE_IMAGE;      
64
 
 }
65
 
 
66
 
 bool ImlibInterface::load(const QString& filename, bool *isReadOnly)