markup icon indicating copy to clipboard operation
markup copied to clipboard

SVG with non-embedded raster images not displaying correctly

Open mukundesh opened this issue 4 years ago • 0 comments

I would like to view SVG with an embedded raster image on GitHub. Currently GitHub displays a SVG file with base64 encoded image data - but not image with a link to a raster image file.

Here is the use case: Most OCR algorithms, and image processing algorithms, work on images and produce output as a set of rectangles that are drawn on the image. These rectangles indicate the words or objected detected in the image. Given that this output is generated for every run of the algorithm, writing an image with the rectangles becomes expensive and an easier solution is to just generate a SVG with the embedded raster image and rectangles generated for the run.

I understand that this could be disabled because of security issues, but at least the images that are present in GitHub or on GitHub Pages should be loaded in SVG, is there anything I can do ?

Here is a repository with different images

  1. No Image: https://github.com/mukundesh/testSVG/blob/main/test-noimg.svg
  2. embedded raster image: https://github.com/mukundesh/testSVG/blob/main/test-raster-embed.svg
  3. local raster image: https://github.com/mukundesh/testSVG/blob/main/test-local-image.svg
  4. internet raster image: https://github.com/mukundesh/testSVG/blob/main/test-internet-image.svg

The last two files display correctly locally.

mukundesh avatar Dec 31 '21 11:12 mukundesh