GNOME Bugzilla – Bug 732923
typefinding: mis-detects true type font file as mp3
Last modified: 2018-11-03 11:30:31 UTC
Created attachment 280191 [details] Rhythmbox window showing TTF files as valid audio tracks. TTF font file is reported as "audio/mpeg" as shown below: sid@unstable:~/work/gstreamer$ gst-typefind-1.0 /usr/share/fonts/truetype/fonts-japanese-gothic.ttf /usr/share/fonts/truetype/fonts-japanese-gothic.ttf - audio/mpeg, mpegversion=(int)1, layer=(int)1, parsed=(boolean)false GstDiscoverer library also returned "audio/mpeg" More information on the file: sid@unstable:~$ ls -l /usr/share/fonts/truetype/fonts-japanese-gothic.ttf lrwxrwxrwx 1 root root 43 Jul 7 13:11 /usr/share/fonts/truetype/fonts-japanese-gothic.ttf -> /etc/alternatives/fonts-japanese-gothic.ttf sid@unstable:~$ ls -l /etc/alternatives/fonts-japanese-gothic.ttf lrwxrwxrwx 1 root root 53 Jul 7 13:11 /etc/alternatives/fonts-japanese-gothic.ttf -> /usr/share/fonts/opentype/ipaexfont-gothic/ipaexg.ttf sid@unstable:~$ dpkg -S /usr/share/fonts/opentype/ipaexfont-gothic/ipaexg.ttf fonts-ipaexfont-gothic: /usr/share/fonts/opentype/ipaexfont-gothic/ipaexg.ttf Due to this, rhythmbox imports incorrect files ( refer attachment )
This is on latest debian sid 'amd64'. sid@unstable:~$ apt-cache show libgstreamer-plugins-base1.0-0:amd64 Package: libgstreamer-plugins-base1.0-0 Source: gst-plugins-base1.0 Version: 1.2.4-1 Installed-Size: 2949 Maintainer: Maintainers of GStreamer packages <pkg-gstreamer-maintainers@lists.alioth.debian.org> Architecture: amd64 Depends: libc6 (>= 2.14), libglib2.0-0 (>= 2.37.3), libgstreamer1.0-0 (>= 1.2.0), liborc-0.4-0 (>= 1:0.4.18), zlib1g (>= 1:1.1.4), iso-codes Pre-Depends: multiarch-support Suggests: libvisual-0.4-plugins, gstreamer-codec-install | gnome-codec-install Breaks: totem-gstreamer (<= 2.17.92-0ubuntu1) Description-en: GStreamer libraries from the "base" set GStreamer is a streaming media framework, based on graphs of filters which operate on media data. Applications using this library can do anything from real-time sound processing to playing videos, and just about anything else media-related. Its plugin-based architecture means that new data types or processing capabilities can be added simply by installing new plug-ins. . This package contains libraries from the "base" set, an essential exemplary set of elements. Description-md5: 1f83d48f1815b1413bf5322dc753ba59 Multi-Arch: same Homepage: http://gstreamer.freedesktop.org/modules/gst-plugins-base.html Tag: role::shared-lib Section: libs Priority: optional Filename: pool/main/g/gst-plugins-base1.0/libgstreamer-plugins-base1.0-0_1.2.4-1_amd64.deb Size: 1217880 MD5sum: 1617974890296214a3a857256db7abd2 SHA1: 55aadf1d672d1b84b6b6ed3d3c6287d3308d9234 SHA256: 05980391d656226edba69f5d518f5faba746efafb4519f8c380321a6ea62d34f
Created attachment 280194 [details] GST library incorrectly detecting file types ( uses gst-typefind command )
Created attachment 280195 [details] Correct file types ( uses file command ) for file in attachment 280194 [details]
Comment on attachment 280191 [details] Rhythmbox window showing TTF files as valid audio tracks. /usr/share/fonts/ was given as the import directory for this output. This was on latest 'debian sid: amd64'
Its reproducable. We probably need to add ttf detection to be able to early exit.
The issue still remains in "gstreamer1.0-tools 1.8.2" dev@unstable:~$ ls -l /usr/share/fonts/truetype/dejavu/DejaVuSans.ttf -rw-r--r-- 1 root root 757076 Jul 14 12:23 /usr/share/fonts/truetype/dejavu/DejaVuSans.ttf dev@unstable:~$ gst-typefind-1.0 /usr/share/fonts/truetype/dejavu/DejaVuSans.ttf /usr/share/fonts/truetype/dejavu/DejaVuSans.ttf - video/mpeg, systemstream=(boolean)false, mpegversion=(int)1, parsed=(boolean)false
Yes, that's why the bug is still open :)
Ok. Good to know :)
Created attachment 333569 [details] [review] typefind: add match for truetype and opentype fonts I have this patch in my tree to workaround this issue if anyone is interested.
Comment on attachment 333569 [details] [review] typefind: add match for truetype and opentype fonts Cool, thanks for attaching these. I think I'd really like something stronger though, ie. typefinders that check more data than just the first 4/5 bytes for a "LIKELY" result.
I agree, that's probably why I didn't contribute the patch before. I've never had a false positive though with this patch.
Created attachment 352105 [details] [review] add ttf typefinder
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/124.