Bug 136643

Summary: showfoto can open CRW, but not shown in file dialogue
Product: [Applications] digikam Reporter: Simon Oosthoek <kdebugs>
Component: Showfoto-UsabilityAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: caulier.gilles
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In: 0.9.0
Sentry Crash Report:

Description Simon Oosthoek 2006-11-01 15:33:56 UTC
Version:           0.4.0 (using KDE KDE 3.5.5)
Installed from:    Compiled From Sources
Compiler:          gcc (GCC) 4.1.2 20060901 (prerelease) (Debian 4.1.1-13) 
OS:                Linux

When showfoto is running, opening a file using the file dialogue doesn't show .CRW files in the directory. It does show ppm, thm and jpg files, but not the CRW (canon raw) files.

starting showfoto from the commandline with the CRW file will open it without problems.
Comment 1 Simon Oosthoek 2006-11-04 20:05:00 UTC
Looking at the code, could it be going wrong here (from showfoto.cpp:line 496)
I don't know anything about the code, but could it be that the KDE version isn't determined correctly in the ifdef? Or that the extensions list in KDE may have been updated to be complete now? It seems like a weird workaround for a temporary problem...


void ShowFoto::slotOpenFile()
{
    if (d->currentItem && !promptUserSave(d->currentItem->url()))
        return;

    QString fileformats;

#if KDE_IS_VERSION(3,5,2)
    //-- With KDE version >= 3.5.2, "image/x-raw" type mime exist ------------------------------

    // TODO: - Remove all image/x-raw file format given by KDE and check if dcraw is available.
    //       - Use the Raw file extension giving by digiKam API instead, because the list given
    //         by KDE is uncomplete.
    fileformats = KImageIO::mimeTypes(KImageIO::Reading).join(" ");
#else
    //-- with KDE version < 3.5.2, we need to add all camera RAW file formats ------------------

    QStringList patternList = QStringList::split('\n', KImageIO::pattern(KImageIO::Reading));

    // All Pictures from list must been always the first entry given by KDE API
    QString allPictures = patternList[0];

    // Add RAW file format to All Pictures" type mime and remplace current.
    if (Digikam::DcrawBinary::instance()->versionIsRight())
    {
        allPictures.insert(allPictures.find("|"), QString(raw_file_extentions));
        patternList.remove(patternList[0]);
        patternList.prepend(allPictures);
    }

    // Added RAW file formats supported by dcraw program like a type mime.
    // Nota: we cannot use here "image/x-raw" type mime from KDE because it
    // will be only available for KDE 3.5.2, not before (see file #121242 in B.K.O).
    if (Digikam::DcrawBinary::instance()->versionIsRight())
    {
        patternList.append(i18n("\n%1|Camera RAW files").arg(QString(raw_file_extentions)));
    }

    fileformats = patternList.join("\n");
#endif

Comment 2 caulier.gilles 2006-11-09 10:37:27 UTC
Fixed in svn by commit #603500

I close this file now.

Gilles Caulier
Comment 3 Simon Oosthoek 2007-12-30 10:43:11 UTC
Before I reopen this, or create a new bugreport for digikam 0.9.3. I now find that in digikam, the "open with..." item in the right-mouse menu is empty for my .ARW files. I thought this has something to do with the KDE file associations (which are hard to find these days, since the control is not in kubuntu system settings), but I wasn't able to change the mime settings to get the right behaviour. I would like to be able edit my .ARW files using the Gimp and getting this in a right-mouse menu would make this easy from digikam. 

I'm starting to use digikam more and more for all my photo related operations, but as I run into problems, I find I ran into similar problems before ;-)

Perhaps this is more a support question than a new bug/feature, unless there is no answer. Is it possible to make this option appear in the "open with..." sub-menu, and if it is, how can this be done?

tnx

Simon