After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 732923 - typefinding: mis-detects true type font file as mp3
typefinding: mis-detects true type font file as mp3
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-07-08 21:28 UTC by gnome.vrb
Modified: 2018-11-03 11:30 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Rhythmbox window showing TTF files as valid audio tracks. (118.30 KB, image/png)
2014-07-08 21:28 UTC, gnome.vrb
  Details
GST library incorrectly detecting file types ( uses gst-typefind command ) (5.38 KB, text/plain)
2014-07-08 22:03 UTC, gnome.vrb
  Details
Correct file types ( uses file command ) for file in attachment 280194 (3.86 KB, text/plain)
2014-07-08 22:05 UTC, gnome.vrb
  Details
typefind: add match for truetype and opentype fonts (1.32 KB, patch)
2016-08-18 16:26 UTC, Arnaud Vrac
reviewed Details | Review
add ttf typefinder (2.20 KB, patch)
2017-05-18 15:04 UTC, Vincent Penquerc'h
none Details | Review

Description gnome.vrb 2014-07-08 21:28: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 )
Comment 1 gnome.vrb 2014-07-08 21:33:26 UTC
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
Comment 2 gnome.vrb 2014-07-08 22:03:54 UTC
Created attachment 280194 [details]
GST library incorrectly detecting file types ( uses gst-typefind command )
Comment 3 gnome.vrb 2014-07-08 22:05:04 UTC
Created attachment 280195 [details]
Correct file types ( uses file command ) for file in attachment 280194 [details]
Comment 4 gnome.vrb 2014-07-08 22:06:56 UTC
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'
Comment 5 Stefan Sauer (gstreamer, gtkdoc dev) 2015-01-23 21:18:25 UTC
Its reproducable. We probably need to add ttf detection to be able to early exit.
Comment 6 gnome.vrb 2016-08-18 08:12:09 UTC
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
Comment 7 Tim-Philipp Müller 2016-08-18 08:24:32 UTC
Yes, that's why the bug is still open :)
Comment 8 gnome.vrb 2016-08-18 08:38:24 UTC
Ok. Good to know :)
Comment 9 Arnaud Vrac 2016-08-18 16:26:11 UTC
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 10 Tim-Philipp Müller 2016-08-18 16:32:10 UTC
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.
Comment 11 Arnaud Vrac 2016-08-18 16:35:23 UTC
I agree, that's probably why I didn't contribute the patch before. I've never had a false positive though with this patch.
Comment 12 Vincent Penquerc'h 2017-05-18 15:04:39 UTC
Created attachment 352105 [details] [review]
add ttf typefinder
Comment 13 GStreamer system administrator 2018-11-03 11:30:31 UTC
-- 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.