Typefind incorrectly finds text/plain when SVG contains base64 data URI
Describe your issue
I want to use rsvgdec
with SVG files that contain embedded images. Even though the images can be correctly decoded with librsvg, GStreamer detects the wrong mime type causing an error.
Expected Behavior
Image gets decoded and rendered with imagefreeze.
Observed Behavior
Fails with the following error:
0:00:01.981117000 34142 0x125f08400 ERROR ges ges-uri-asset.c:726:ges_uri_clip_asset_request_sync: Got an error requesting asset: This appears to be a text file
Setup
- Operating System: Linux and macOS
- GStreamer Version: Latest git
- Command line:
$ gst-discoverer-1.0 image_with_background.svg
Analyzing image_with_background.svg
Done discovering image_with_background.svg
An error was encountered while discovering the file
This appears to be a text file
# Note that librsvg is able to read this file
$ rsvg-convert image_with_background.svg -o image_with_background.png
Steps to reproduce the bug
- Download the attached svg file
- Load it in gstreamer (for example using the command line above)
How reproducible is the bug?
Consistently reproducible with the SVG files with embedded images I tested.
Solutions you have tried
Replacing the base64 data URI with file:// URI works.