1

I am looking for a program that can test if a SVG file contains some raster graphics elements. Linux or Windows, CLI or GUI, and gratis if possible.

  • To test a few files or automatically batch test hundreds or thousands of them? – OuzoPower Dec 7 '17 at 17:51
1

You could modify the program suggested here as follows:

using System;

namespace ExtractBitmapFromSvg
{
    static class ExtractBitmapFromSvg
    {
        static int Main(string[] args)
        {
            var svgFile = new SvgFile(args[0]);
            var images = svgFile.GetEmbeddedImages();
            var hasImages = images.Count > 0;
            Console.WriteLine(hasImages ? "images found" : "no images");
            return hasImages ? 1 : 0;
        }
    }
}

Note that it's incomplete and does not identify all raster graphic types yet.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.