Summary: | mimelnk/x-image-raw.desktop conflicts with kdegraphics-3.5.x | ||
---|---|---|---|
Product: | [Applications] digikam | Reporter: | Jonathan Marten <jjm> |
Component: | Portability-Interroperability | Assignee: | Digikam Developers <digikam-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | caulier.gilles, ddruspam, nicolasg, rdieter |
Priority: | NOR | ||
Version: | 0.8.1 | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | 0.9.0 | |
Sentry Crash Report: | |||
Attachments: | File patterns fix |
Description
Jonathan Marten
2006-02-02 18:12:19 UTC
Agreed, confirmed. Nevermind, just checked my digikam-0.8.1 install, no image/x-raw mimetype to be found (here). As a matter of fact, rpm -q -f /usr/share/mimelink/image/x-image-raw.desktop kdegraphics-3.5.1 and it contains: Patterns=*.crw;*.CRW;*.cr2,*.CR2;*.nef;*.NEF;*.mrw;*.MRW; So, it appears your mimetypes are biffed and vary from factory-defaults. Created attachment 14497 [details]
File patterns fix
Also sets default application for RAW files (AFAIK the Exec= is not allowed in
a MIME type file) and adds the MIME type to those supported by showfoto.
Strange (comment #2)... my 0.8.1 source seems to have digikam-0.8.1/digikam/showfoto/mimetypes/x-raw.desktop which installs as $KDEDIR/share/mimelnk/image/x-raw.desktop. I haven't modified anything from the downloaded source. I have a full install of kdegraphics (KDE 3.5.0), and there is no /usr/share/mimelink/image/x-image-raw.desktop Sorry, my mistake, there is indeed an x-image-raw which comes from kdegraphics. However, in this case there is still duplication and a file pattern clash between x-raw (from digikam) and x-image-raw (from kdegraphics). I've come to the same conclusion. Sorry for the confusion. Since mimelnk/x-image-raw.desktop conflicts with kdegraphics-3.5.x, the easiest fix would be to simply remove it from digikam. Alternatively, if you don't want to require use of kde(graphics) >= 3.5, only install the mimelnk file if not already present. If kept, as originally suggested, Patterns= should be cleaned up. FYI, looks like koffice-1.4.90 includes an x-image-raw.desktop too (bug #121536). Looks like it should be moved to kdelibs. SVN commit 506967 by goutte: image/x-raw is now defined in kdelibs CCBUG:121536 CCBUG:121242 M +1 -4 Makefile.am D x-image-raw.desktop --- trunk/KDE/kdegraphics/kfile-plugins/raw/Makefile.am #506966:506967 @@ -18,10 +18,7 @@ services_DATA = kfile_raw.desktop servicesdir = $(kde_servicesdir) -mimetypeimagedatadir = $(kde_mimedir)/image -mimetypeimagedata_DATA = x-image-raw.desktop - magicdir = $(kde_confdir)/magic magic_DATA = x-image-raw.magic -EXTRA_DIST = $(mimetypeimagedata_DATA) $(magic_DATA) +EXTRA_DIST = $(magic_DATA) To comment #7: to avoid mimetype conflicts, you can check the KDE version on which the application is built and install the mimetypes if KDE is too old. You can look at what I had done in KOffice: trunk/koffice/configure.in.in (everythign having kde32 kde33 kde34 ) and trunk/koffice/mimetypes/Makefile.am where it selects subdirectories of mimetypes depending on the KDE version. For the image/x-raw mimetype, it is now defined in kdelibs. Have a nice day! Hi Nicolas, so AFAICS, xraw.magic and x-image-raw.desktop are moved from kdegrahics to kdelibs in trunk and 3_5_stable, right? Can you add the additional extentions (all supported by dcraw which is used by kio plugins, krita and digikam). You'll find them at https://ach@svn.kde.org/home/kde/trunk/extragear/graphics/digikam/showfoto/mimetypes/x-raw.desktop with kde 3.5 there is one conflict: x-hdr.desktop and x-raw.desktop both use .hdr in patterns. Too late tonight to check for pattern conflicts in trunk and 3_5_stable. Maybe this weekend. FWIW, testing magic: Gilles has some test raw files at http://digikam3rdparty.free.fr/Images_2_Test_DImg/RAW/ Achim On Thursday 09 February 2006 01:20, Achim Bohnet wrote: (...) > Hi Nicolas, > > so AFAICS, xraw.magic and x-image-raw.desktop are moved from kdegrahics > to kdelibs in trunk and 3_5_stable, right? Yes! > > Can you add the additional extentions (all supported by dcraw which > is used by kio plugins, krita and digikam). You'll find them at > > https://ach svn kde > org/home/kde/trunk/extragear/graphics/digikam/showfoto/mimetypes/x-raw > desktop If you have time, you can add them yourself. (I have just moved the mimetype before one of the classical reasons of not moving a mime types happen (nobody to do it, applying the message freeze, etc.)) > > with kde 3.5 there is one conflict: x-hdr.desktop and x-raw.desktop both > use .hdr in patterns. Well, so the conflict has existed before the move too. :-( Are RAW *.hdr files covered by a pattern? If yes, the perhaps the *.hdr pattern should be removed there. > Too late tonight to check for pattern conflicts in > trunk and 3_5_stable. Maybe this weekend. Yes, it would be nice if somebody could double check the pattern rules. I have only checked that the TIFF-like ones where not like TIFF ones (so for files starting in II or MM). If you have time, you (or somebody else) should check the freedesktop.org mimetype database and chekc if mime type and pattern rules exist there. If not, create a bug report at freedesktop.org, please. > > FWIW, testing magic: Gilles has some test raw files at > http://digikam3rdparty.free.fr/Images_2_Test_DImg/RAW/ > > Achim Have a nice day! SVN commit 512608 by goutte: - add file patterns from Krita - change the comment to show "Image" instead of "File" (as other relevant image mime types) CCMAIL:kde-i18n-doc@kde.org CCBUG:121536 CCBUG:121242 M +2 -2 x-raw.desktop --- branches/KDE/3.5/kdelibs/mimetypes/image/x-raw.desktop #512607:512608 @@ -3,8 +3,8 @@ Type=MimeType MimeType=image/x-raw Icon=image -Patterns=*.crw;*.CRW;*.cr2,*.CR2;*.nef;*.NEF;*.mrw;*.MRW; -Comment=RAW Camera File +Patterns=*.raw;*.RAW;*.dcr;*.DCR;*.dng;*.DNG;*.crw;*.CRW;*.cr2,*.CR2;*.nef;*.NEF;*.mrw;*.MRW; +Comment=RAW Camera Image Comment[br]=Restr kamera kriz Comment[ca]=Fitxer de cà mera RAW Comment[cs]=RAW soubor z fotoaparátu *** Bug 124428 has been marked as a duplicate of this bug. *** FYI, digikam-0.8.2-rc1 still installs a x-raw.desktop which conflicts with kdelibs-3.5.2+ (and kdegraphics < 3.5.2 and koffice < 1.5.0). See koffice bug #121536 comment #6 for an example of the autoconf/automake magic to fix. Yeah, I know that it's still in. For debian/kubuntu pkgs we just delete the file before packing the .deb. Someone knows who to tweak the Makefile magic to make the install conditional like if KDE < 3.5.2 then XIMAGERAW = x-image-raw.desktop else XIMAGERAW = fi desktopfiles = a.desktop b.desktop $(XIMAGERAW) Achim SVN commit 541016 by cgilles: digikam from trunk : showfoto and image/x-raw type mime : - removed x-raw.desktop file in conflict with KDE3.5.2 - add a rule into Showfoto::slotOpenFile() to detect witch KDE release we use : * if KDE >= 3.5.2 --> we use image/x-raw pattern from KDE. * if KDE < 3.5.2 --> we construct a new pattern from stcrach. IMPORTANT : this code have been tested under Mandriva 2006.0 official using KDE 3.4.2. It's untested with KDE > 3.4.2. Please give me a feedback if all is ok to close this file ! CCMAIL: digikam-devel@kde.org CCBUGS: 121242 D mimetypes (directory) M +28 -7 showfoto.cpp M +1 -1 showfoto.desktop --- trunk/extragear/graphics/digikam/showfoto/showfoto.cpp #541015:541016 @@ -387,16 +387,37 @@ if (m_currentItem && !promptUserSave(m_currentItem->url())) return; - QString mimetypes = KImageIO::mimeTypes(KImageIO::Reading).join(" "); + QString fileformats; - // Added RAW file format type mimes supported by dcraw program. - mimetypes.append (" image/x-raw"); +#if KDE_IS_VERSION(3,5,2) + //-- With KDE version >= 3.5.2, "image/x-raw" type mime exist ------------------------------ - KURL::List urls = KFileDialog::getOpenURLs(m_lastOpenedDirectory.path(), - mimetypes, - this, - i18n("Open Images")); + 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. + 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). + patternList.append(QString("\n%1|Camera RAW files").arg(QString(raw_file_extentions))); + + fileformats = patternList.join("\n"); +#endif + kdDebug () << "fileformats=" << fileformats << endl; + + KURL::List urls = KFileDialog::getOpenURLs(m_lastOpenedDirectory.path(), fileformats, this, i18n("Open Images")); + if (!urls.isEmpty()) { m_bar->clear(); --- trunk/extragear/graphics/digikam/showfoto/showfoto.desktop #541015:541016 @@ -59,7 +59,7 @@ Exec=showfoto %i %m -caption "%c" %U Icon=showfoto Type=Application -MimeType=image/gif;image/x-xpm;image/x-xbm;image/jpeg;image/png;image/tiff;image/x-bmp;image/x-psd;image/x-eim;image/x-portable-bitmap;image/x-portable-pixmap;image/x-portable-greymap +MimeType=image/gif;image/x-xpm;image/x-xbm;image/jpeg;image/png;image/tiff;image/x-bmp;image/x-psd;image/x-eim;image/x-portable-bitmap;image/x-portable-pixmap;image/x-portable-greymap;image/x-raw Terminal=false Categories=Qt;KDE;Graphics; DocPath=showfoto/index.html SVN commit 541017 by cgilles: digikam from stable : showfoto and image/x-raw type mime : - removed x-raw.desktop file in conflict with KDE3.5.2 - add a rule into Showfoto::slotOpenFile() to detect witch KDE release we use : * if KDE >= 3.5.2 --> we use image/x-raw pattern from KDE. * if KDE < 3.5.2 --> we construct a new pattern from sctrach. IMPORTANT : this code have been tested under Mandriva 2006.0 official using KDE 3.4.2. It's untested with KDE > 3.4.2. Please give me a feedback if all is ok to close this file ! CCMAIL: digikam-devel@kde.org CCBUGS: 121242 D mimetypes (directory) M +29 -8 showfoto.cpp M +1 -1 showfoto.desktop --- branches/stable/extragear/graphics/digikam/showfoto/showfoto.cpp #541016:541017 @@ -587,15 +587,36 @@ if (!promptUserSave()) return; - QString mimetypes = KImageIO::mimeTypes(KImageIO::Reading).join(" "); + QString fileformats; + +#if KDE_IS_VERSION(3,5,2) + //-- With KDE version >= 3.5.2, "image/x-raw" type mime exist ------------------------------ + + 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. + 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). + patternList.append(QString("\n%1|Camera RAW files").arg(QString(raw_file_extentions))); + + fileformats = patternList.join("\n"); +#endif - // Added RAW file format type mimes supported by dcraw program. - mimetypes.append (" image/x-raw"); - - KURL::List urls = KFileDialog::getOpenURLs(m_lastOpenedDirectory.path(), - mimetypes, - this, - i18n("Open Images")); + kdDebug () << "fileformats=" << fileformats << endl; + + KURL::List urls = KFileDialog::getOpenURLs(m_lastOpenedDirectory.path(), fileformats, this, i18n("Open Images")); if (!urls.isEmpty()) { --- branches/stable/extragear/graphics/digikam/showfoto/showfoto.desktop #541016:541017 @@ -57,7 +57,7 @@ Exec=showfoto %i %m -caption "%c" %U Icon=showfoto Type=Application -MimeType=image/gif;image/x-xpm;image/x-xbm;image/jpeg;image/png;image/tiff;image/x-bmp;image/x-psd;image/x-eim;image/x-portable-bitmap;image/x-portable-pixmap;image/x-portable-greymap +MimeType=image/gif;image/x-xpm;image/x-xbm;image/jpeg;image/png;image/tiff;image/x-bmp;image/x-psd;image/x-eim;image/x-portable-bitmap;image/x-portable-pixmap;image/x-portable-greymap;image/x-raw Terminal=false Categories=Qt;KDE;Graphics; DocPath=showfoto/index.html Nicolas, IMPORTANT : your pattern in standard KDE x-raw.desktop file is uncomplete : http://websvn.kde.org/branches/KDE/3.5/kdelibs/mimetypes/image/x-raw.desktop?rev=539607&view=auto We have : *.raw;*.RAW;*.dcr;*.DCR;*.dng;*.DNG;*.crw;*.CRW;*.cr2,*.CR2;*.nef;*.NEF;*.mrw;*.MRW; The real RAW file format pattern supported by dcraw is : *.bay *.bmq *.cr2 *.crw *.cs1 *.dc2 *.dcr *.dng *.erf *.fff *.hdr *.k25 *.kdc *.mdc *.mos *.mrw *.nef *.orf *.pef *.pxn *.raf *.raw *.rdc *.sr2 *.srf *.x3f ... This list come from dcraw source code itself !!! Please update... Gilles Caulier Nicolas, Same problem into KDE 4.0 : http://websvn.kde.org/trunk/KDE/kdelibs/mimetypes/image/x-raw.desktop?rev=512649&view=auto Gilles Caulier The KDE RAW file mime type have been fixed by Laurent Montel into svn. Thanks to him (:=))) I close this file now. Gilles Caulier |