How to fix broken iso file associations from text/plain to raw CD image file in openSUSE 13.2

FIX HAS BEEN FOUND

I found a fix for the broken ISO file associations. A special thanks to margueritesu who found the patch that created this mess.
A patch that was added between 1.2 and 1.3 referring to** “x-wii-rom”** broke the ISO.

Here are the steps:

  1. Open konsole and type kdesu kwrite – then your password
  2. Navigate to /usr/share/mime/packages/freedesktop.org.xml
  3. Open freedesktop.org.xml
  4. In kwrite navigate to Edit -->Go to Line
  5. Type in: 7951
    and press <enter> 1. At the beginning of the line 7951
    type <!-- in front of <mime-type type=“application/x-wii-rom”> 1. Type in: 7972
    and press <enter> 1. At the end of line 7972 – add this → after </mime-type> →
  6. Save your changes and close kwrite

The entire “application/x-wii-rom” and “application-x-gamecube-rom” block example appears below:

<!--  <mime-type type="application/x-wii-rom">
    <comment>Wii disc image</comment>
    <alias type="application/x-wii-iso-image"/>
    <alias type="application/x-wbfs"/>
    <alias type="application/x-wia"/>
    <generic-icon name="application-x-executable"/>
    <glob pattern="*.iso"/>
    <magic priority="50">
      <match value="0x5d1c9ea3" type="big32" offset="24"/>
      <match value="WBFS" type="string" offset="0"/>
      <match value="WII\001DISC" type="string" offset="0"/>
    </magic>
  </mime-type>
  <mime-type type="application/x-gamecube-rom">
    <comment>GameCube disc image</comment>
    <generic-icon name="application-x-executable"/>
    <alias type="application/x-gamecube-iso-image"/>
    <glob pattern="*.iso"/>
    <magic priority="50">
      <match value="0xc2339f3d" type="big32" offset="28"/>
    </magic>
  </mime-type> -->

**Note: **Open konsole or xterm. Type: " su - " (without the quotes) followed by your password. Then:

# update-mime-database /usr/share/mime/

Once the entire “Wii disc image” and “GameCube disc image” block has been commented out the ISO image files return to their correct association.

On 2014-11-14 22:16, Romanator wrote:
>
> FIX HAS BEEN FOUND

Bugzilla, please?


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)

See: https://forums.opensuse.org/showthread.php/502055-kde4-mime-list-is-broken-for-iso-file-associations-they-appear-as-text-files?p=2676642#post2676642

Follow Up

I have found a third option on repairing the broken association with ISO files. It has been submitted to the people maintaining the “shared-mime-info” package.
Increasing the glob weight for patterns “.iso” and “.iso9660” fixes the priority problem.

  1. Start kate or
  2. Open “dolphin -super user mode”
  3. kwrite
  4. Navigate to Edit → Go to Line and type 7200. Press the enter key.

This edit is for the entry “x-cd-image”. You will be editing lines 7200 and 7201.

The original entries appears as:

<glob pattern="*.iso"/>
<glob pattern="*.iso9660"/>

Change it to:

<glob weight="60" pattern="*.iso"/>
<glob weight="60" pattern="*.iso9660"/>

Click on Save, close your editor and dolphin.

Open konsole or xterm and log in as “su -” (without the quotes).

Copy and paste the line below and press enter.

update-mime-database /usr/share/mime/

Open dolphin and check the ISO files. You will see the correct CD icon has returned and the files are now recognized as x-cd-image files.

Important Follow Up

A patch has been accepted by the maintainers of shared-mime-info.

See: Bump priority for ISO images glob matching](http://cgit.freedesktop.org/xdg/shared-mime-info/commit/)**

Bump priority for ISO images glob matching**

To work-around file managers that cannot use magic to differentiate mime-types. https://bugs.freedesktop.org/show_bug.cgi?id=80877

What’s changed? For the entry for x-cd-image. The original glob pattern entry is:

<glob pattern="*.iso"/>

New entry is:

<glob pattern="*.iso" weight="80"/>

This should be available in the official release later this year.