Bug 33338 - Create Image Gallery fails for xpm
Summary: Create Image Gallery fails for xpm
Status: RESOLVED FIXED
Alias: None
Product: konqueror
Classification: Applications
Component: general (show other bugs)
Version: 2.2.1
Platform: Mandrake RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-10-05 17:18 UTC by lrnagy
Modified: 2003-01-13 07:26 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description lrnagy 2001-10-05 17:17:19 UTC
(*** This bug was imported into bugs.kde.org ***)

Package:           konqueror
Version:           2.2.1 (using KDE 2.2.1 )
Severity:          normal
Installed from:    Mandrake RPMs
Compiler:          Not Specified
OS:                Linux
OS/Compiler notes: Not Specified

Creating an image gallery creates and "empty" page when directory contains xpm files. By empty I mean the html file has no images.

(Submitted via bugs.kde.org)
(Called from KBugReport dialog. Fields KDE Version OS Compiler manually changed)
Comment 1 Maksim Orlovich 2003-01-13 07:26:23 UTC
Subject: kdeaddons/konq-plugins/kimgalleryplugin

CVS commit by orlovich: 


-Use KImageIO to find out list of supported extensions, and don't hardcode it.
Fixes #33338 - XPM files getting ignored.

CCMAIL: 33338-done@bugs.kde.org


  M +8 -1      imgalleryplugin.cpp   1.38


--- kdeaddons/konq-plugins/kimgalleryplugin/imgalleryplugin.cpp  #1.37:1.38
@@ -36,4 +36,5 @@ Boston, MA 02111-1307, USA.
 #include <kurl.h>
 #include <kapplication.h>
+#include <kimageio.h>
 #include <kdebug.h>
 #include <kgenericfactory.h>
@@ -279,5 +281,10 @@ bool KImGalleryPlugin::createHtml(const 
 
   kdDebug() << "sourceDirName: " << sourceDirName << endl;
-  QDir imageDir( sourceDirName, "*.png *.PNG *.gif *.GIF *.jpg *.JPG *.jpeg *.JPEG *.bmp *.BMP",
+  QString suffixes;
+  //We're interested in only the patterns, so look for the first |
+  //#### perhaps an accessor should be added to KImageIO instead?
+  QString filter = KImageIO::pattern(KImageIO::Reading).section('|', 0, 0);
+  
+  QDir imageDir( sourceDirName, filter.latin1(),
                  QDir::Name|QDir::IgnoreCase, QDir::Files|QDir::Readable);