An SVG image should be processed with the MIME type image / svg + xml, so I would recommend checking this out first. One way to check the type of MIME used is to use wget to get the image. Here is an example of wget output. Notice where it displays the MIME type:
jacob@jacob-laptop :~/tmp$ wget http://croczilla.com/bits_and_pieces/svg/samples/butterfly/butterfly.svg --2011-07-25 11:32:04-- http://croczilla.com/bits_and_pieces/svg/samples/butterfly/butterfly.svg Resolving croczilla.com... 77.92.68.237 Connecting to croczilla.com|77.92.68.237|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 31187 (30K) [image/svg+xml] Saving to: `butterfly.svg' 100%[====================================================================>] 31,187 84.5K/s in 0.4s
If the MIME type is image / svg + xml in both cases, then I would distinguish between the contents of both documents to see if there are differences between them.
In addition, although this does not answer your question, you should also be aware that not all browsers support the img HTML tag for rendering SVG. The reason for this is that, as a rule, img tags used less security than object or embed tags. You can read here for more information on this: Reliable detection <img> tag support for SVG
jbeard4
source share