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

List:       kde-commits
Subject:    koffice/filters/krita/magick
From:       Melchior Franz <mfranz () kde ! org>
Date:       2006-03-02 14:01:15
Message-ID: 1141308075.067388.28809.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 515046 by mfranz:

Save images with *.rgb extensions as "SGI", too. Krita recognizes
images with this extension correctly, but it only writes them when
named *.sgi, which is the most "official", but least commonly used.

I tried to make krita save *.rgba and *.bw images as SGI, too,
but this refused to work.

  $ grep Pattern $KDEDIR/share/mimelnk/image/x-rgb.desktop
  Patterns=*.rgb;*.RGB;*.rgba;*.RGBA;*.bw;*.BW;*.sgi;*.SGI


 M  +7 -2      kis_image_magick_converter.cc  


--- trunk/koffice/filters/krita/magick/kis_image_magick_converter.cc #515045:515046
@@ -704,12 +704,17 @@
         width = img -> width();
 
         bool alpha = true;
-        if (QFileInfo(QFile::encodeName(uri.path())).extension(false).upper() == "BMP") {
+        QString ext = QFileInfo(QFile::encodeName(uri.path())).extension(false).upper();
+        if (ext == "BMP") {
             alpha = false;
             qstrncpy(ii->magick, "BMP2", MaxTextExtent - 1);
             kdDebug() << ii->magick << "|" << endl;
         }
-        
+        else if (ext == "RGB") {
+            qstrncpy(ii->magick, "SGI", MaxTextExtent - 1);
+            kdDebug() << ii->magick << "|" << endl;
+        }
+
         for (y = 0; y < height; y++) {
 
             // Allocate pixels for this scanline
[prev in list] [next in list] [prev in thread] [next in thread] 

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