[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    [Patch] Add support for interlace mode to kfile_png
From:       Volker Krause <volker.krause () web ! de>
Date:       2002-08-30 12:18:45
[Download RAW message or body]

Hello,

the attached patch adds support for the interlace mode to the PNG file plugin. 
The current PNG spec only knows two diffrent modes: Adam7 (byte 28 is set to 
1) or none (byte 28 is set to 0).

regards
Volker Krause
["kfile_png_interlace.diff" (text/x-diff)]

Index: kfile_png.cpp
===================================================================
RCS file: /home/kde/kdegraphics/kfile-plugins/png/kfile_png.cpp,v
retrieving revision 1.15
diff -u -r1.15 kfile_png.cpp
--- kfile_png.cpp	29 Aug 2002 17:46:06 -0000	1.15
+++ kfile_png.cpp	30 Aug 2002 11:43:45 -0000
@@ -71,6 +71,12 @@
 {
   I18N_NOOP("Deflate")
 };
+ 
+  // interlaced modes
+static const char* interlaceModes[] = {
+  I18N_NOOP("None"),
+  I18N_NOOP("Adam7")
+};
 
 typedef KGenericFactory<KPngPlugin> PngFactory;
 
@@ -103,6 +109,7 @@
 
     addItemInfo(group, "ColorMode", i18n("Color mode"), QVariant::String);
     addItemInfo(group, "Compression", i18n("Compression"), QVariant::String);
+    addItemInfo(group, "InterlaceMode", i18n("Interlace mode"),QVariant::String);
 }
 
 bool KPngPlugin::readInfo( KFileMetaInfo& info, uint what)
@@ -157,6 +164,8 @@
                             (type < sizeof(colors)/sizeof(colors[0])) ? \
i18n(colors[data[25]]) : i18n("Unknown"));  appendItem(techgroup, "Compression",
                             (data[26] < \
sizeof(compressions)/sizeof(compressions[0])) ? i18n(compressions[data[26]]) : \
i18n("Unknown")); +            appendItem(techgroup, "InterlaceMode",
+                            (data[28] < \
sizeof(interlaceModes)/sizeof(interlaceModes[0])) ? i18n(interlaceModes[data[28]]) : \
i18n("Unknown"));  }
 
         // look for a tEXt chunk
Index: kfile_png.desktop
===================================================================
RCS file: /home/kde/kdegraphics/kfile-plugins/png/kfile_png.desktop,v
retrieving revision 1.38
diff -u -r1.38 kfile_png.desktop
--- kfile_png.desktop	31 Jul 2002 10:46:55 -0000	1.38
+++ kfile_png.desktop	30 Aug 2002 11:43:45 -0000
@@ -40,4 +40,4 @@
 X-KDE-Library=kfile_png
 MimeType=image/png
 PreferredGroups=Comment,Technical
-PreferredItems=Title,Author,Dimensions,BitDepth,ColorMode,Compression
+PreferredItems=Title,Author,Dimensions,BitDepth,ColorMode,Compression,InterlaceMode


>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic