[Webkit-unassigned] [Bug 193194] New: Unable to set the correct MIME type when slicing a blob

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jan 7 06:49:46 PST 2019


            Bug ID: 193194
           Summary: Unable to set the correct MIME type when slicing a
           Product: WebKit
           Version: Safari 10
          Hardware: Macintosh
                OS: macOS 10.12
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: New Bugs
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: valentin.ledrapier at gmail.com

When using blob.slice() passing a new MIME type, it looks that the new blob MIME type is not handled properly.

In my example, I slice a "text/plain" blob passing "image/svg+xml" as a new MIME type. The svg is not displayed on Safari (it works on Chrome and Mozilla).

const blob = new Blob([svg], {
  type: "text/plain",

const slicedBlob = blob.slice(0, blob.size, "image/svg+xml");
const url = URL.createObjectURL(slicedBlob);
img.src = url;

Demo: https://jsbin.com/sehomiyoti/edit?js,output

However, it looks that it work with some other MIME types (png or jpeg for instance).
Maybe some MIME types are somehow detected when used in an <img> element, and the image can still be displayed even if its MIME type is inconsistent ?

You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20190107/19194eb2/attachment-0001.html>

More information about the webkit-unassigned mailing list