You are not logged in.

#1 2021-10-10 09:57:15

yutanagano
Member
Registered: 2021-07-25
Posts: 20

[SOLVED] MIME type not recognised

Hi all,

I've noticed that the blender 3D modelling files (*.blend) I have on my computer are recognised by xdg-mime as being of mime-type application/octet-stream.

This is strange, as I have checked the /usr/share/mime directory where the system settings are in terms of mime types, and an "x-blender" mime-type exists where the glob pattern is set to: "*.blender", "*.blend", and "*.BLEND".

Given the extensions of my files, I wasn't sure why xdg-mime is not picking up the files as application/x-blender instead.

This is quite annoying- does anyone know any reason why this might be occuring?

I have tried running

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

in case these entries were not reflected by xdg-mime or something, but that didn't make a difference.

This is the entry for the application/x-blender mime type in /usr/share/mime/packages/freedesktop.org.xml:

  <mime-type type="application/x-blender">
    <comment>Blender scene</comment>
    <comment xml:lang="af">Blender-toneel</comment>
    <comment xml:lang="ar">مشهد بلندر</comment>
    <comment xml:lang="ast">Escena de Blender</comment>
    <comment xml:lang="be-Latn">Scena Blender</comment>
    <comment xml:lang="bg">Сцена — Blender</comment>
    <comment xml:lang="ca">escena de Blender</comment>
    <comment xml:lang="cs">scéna Blender</comment>
    <comment xml:lang="da">Blenderscene</comment>
    <comment xml:lang="de">Blender-Szene</comment>
    <comment xml:lang="el">Σκηνή Blender</comment>
    <comment xml:lang="en-GB">Blender scene</comment>
    <comment xml:lang="eo">Blender-sceno</comment>
    <comment xml:lang="es">escena de Blender</comment>
    <comment xml:lang="eu">Blender-eko fitxategia</comment>
    <comment xml:lang="fi">Blender-näkymä</comment>
    <comment xml:lang="fo">Blender leikmynd</comment>
    <comment xml:lang="fr">scène Blender</comment>
    <comment xml:lang="fur">sene Blender</comment>
    <comment xml:lang="ga">radharc Blender</comment>
    <comment xml:lang="gl">escena de Blender</comment>
    <comment xml:lang="he">סצנת Blender</comment>
    <comment xml:lang="hr">Blender scena</comment>
    <comment xml:lang="hu">Blender-jelenet</comment>
    <comment xml:lang="ia">Scena Blender</comment>
    <comment xml:lang="id">Scene Blender</comment>
    <comment xml:lang="it">Scena Blender</comment>
    <comment xml:lang="ja">Blender シーン</comment>
    <comment xml:lang="ka">Blender-ის სცენა</comment>
    <comment xml:lang="kk">Blender сахнасы</comment>
    <comment xml:lang="ko">Blender 장면</comment>
    <comment xml:lang="lt">Blender scena</comment>
    <comment xml:lang="lv">Blender aina</comment>
    <comment xml:lang="ms">Babak Blender</comment>
    <comment xml:lang="nb">Blender-scene</comment>
    <comment xml:lang="nl">Blender-scène</comment>
    <comment xml:lang="nn">Blender-scene</comment>
    <comment xml:lang="oc">scèna Blender</comment>
    <comment xml:lang="pl">Scena programu Blender</comment>
    <comment xml:lang="pt">cenário Blender</comment>
    <comment xml:lang="pt-BR">Cena do Blender</comment>
    <comment xml:lang="ro">Scenă Blender</comment>
    <comment xml:lang="ru">Сцена Blender</comment>
    <comment xml:lang="sk">Scéna Blender</comment>
    <comment xml:lang="sl">Datoteka scene Blender</comment>
    <comment xml:lang="sq">Skenë Blender</comment>
    <comment xml:lang="sr">Блендерова сцена</comment>
    <comment xml:lang="sv">Blender-scen</comment>
    <comment xml:lang="tr">Blender sahnesi</comment>
    <comment xml:lang="uk">сцена Blender</comment>
    <comment xml:lang="vi">Cảnh Blender</comment>
    <comment xml:lang="zh-CN">Blender 场景</comment>
    <comment xml:lang="zh-TW">Blender 場景</comment>
    <generic-icon name="image-x-generic"/>
    <glob pattern="*.blender"/>
    <glob pattern="*.blend"/>
    <glob pattern="*.BLEND"/>
    <magic priority="50">
      <match type="string" value="BLENDER" offset="0"/>
    </magic>
  </mime-type>

This is what is inside /usr/share/mime/application/x-blender.xml:

<?xml version="1.0" encoding="utf-8"?>
<mime-type xmlns="http://www.freedesktop.org/standards/shared-mime-info" type="application/x-blender">
  <!--Created automatically by update-mime-database. DO NOT EDIT!-->
  <comment>Blender scene</comment>
  <comment xml:lang="af">Blender-toneel</comment>
  <comment xml:lang="ar">مشهد بلندر</comment>
  <comment xml:lang="ast">Escena de Blender</comment>
  <comment xml:lang="be-Latn">Scena Blender</comment>
  <comment xml:lang="bg">Сцена — Blender</comment>
  <comment xml:lang="ca">escena de Blender</comment>
  <comment xml:lang="cs">scéna Blender</comment>
  <comment xml:lang="da">Blenderscene</comment>
  <comment xml:lang="de">Blender-Szene</comment>
  <comment xml:lang="el">Σκηνή Blender</comment>
  <comment xml:lang="en-GB">Blender scene</comment>
  <comment xml:lang="eo">Blender-sceno</comment>
  <comment xml:lang="es">escena de Blender</comment>
  <comment xml:lang="eu">Blender-eko fitxategia</comment>
  <comment xml:lang="fi">Blender-näkymä</comment>
  <comment xml:lang="fo">Blender leikmynd</comment>
  <comment xml:lang="fr">scène Blender</comment>
  <comment xml:lang="fur">sene Blender</comment>
  <comment xml:lang="ga">radharc Blender</comment>
  <comment xml:lang="gl">escena de Blender</comment>
  <comment xml:lang="he">סצנת Blender</comment>
  <comment xml:lang="hr">Blender scena</comment>
  <comment xml:lang="hu">Blender-jelenet</comment>
  <comment xml:lang="ia">Scena Blender</comment>
  <comment xml:lang="id">Scene Blender</comment>
  <comment xml:lang="it">Scena Blender</comment>
  <comment xml:lang="ja">Blender シーン</comment>
  <comment xml:lang="ka">Blender-ის სცენა</comment>
  <comment xml:lang="kk">Blender сахнасы</comment>
  <comment xml:lang="ko">Blender 장면</comment>
  <comment xml:lang="lt">Blender scena</comment>
  <comment xml:lang="lv">Blender aina</comment>
  <comment xml:lang="ms">Babak Blender</comment>
  <comment xml:lang="nb">Blender-scene</comment>
  <comment xml:lang="nl">Blender-scène</comment>
  <comment xml:lang="nn">Blender-scene</comment>
  <comment xml:lang="oc">scèna Blender</comment>
  <comment xml:lang="pl">Scena programu Blender</comment>
  <comment xml:lang="pt">cenário Blender</comment>
  <comment xml:lang="pt-BR">Cena do Blender</comment>
  <comment xml:lang="ro">Scenă Blender</comment>
  <comment xml:lang="ru">Сцена Blender</comment>
  <comment xml:lang="sk">Scéna Blender</comment>
  <comment xml:lang="sl">Datoteka scene Blender</comment>
  <comment xml:lang="sq">Skenë Blender</comment>
  <comment xml:lang="sr">Блендерова сцена</comment>
  <comment xml:lang="sv">Blender-scen</comment>
  <comment xml:lang="tr">Blender sahnesi</comment>
  <comment xml:lang="uk">сцена Blender</comment>
  <comment xml:lang="vi">Cảnh Blender</comment>
  <comment xml:lang="zh-CN">Blender 场景</comment>
  <comment xml:lang="zh-TW">Blender 場景</comment>
  <generic-icon name="image-x-generic"/>
  <glob pattern="*.blender"/>
  <glob pattern="*.blend"/>
  <glob pattern="*.BLEND"/>
</mime-type>

I'm sure I'm missing something stupid. Thanks in advance!

Last edited by yutanagano (2021-10-13 17:05:00)

Offline

#2 2021-10-10 10:20:16

progandy
Member
Registered: 2012-05-17
Posts: 5,190

Re: [SOLVED] MIME type not recognised

In most cases, xdg-mime uses "file -i" to get the mimetype. "file -i" uses its own internal mime database that seems to be missing blender support.
You can install the package perl-file-mimeinfo, then the "mimetype" tool is preferred which does rely on the definitions in /usr/share/mime and should work.

There are two special cases: For gnome xdg-mime uses "gio info", and for kde "kmimetypefinder".


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#3 2021-10-13 17:04:47

yutanagano
Member
Registered: 2021-07-25
Posts: 20

Re: [SOLVED] MIME type not recognised

@progandy, thank you for your reply. I have just installed perl-file-mimeinfo and everything is working as expected! I will mark this thread as solved.

Offline

Board footer

Powered by FluxBB