Quantcast
Channel: magick Discussions Rss Feed
Viewing all articles
Browse latest Browse all 3693

New Post: Is MagickImage thread safe for reading?

$
0
0
Reading from a MagickImage is thread safe. You can do the following without any problems:
using (MagickImage watermark = new MagickImage(@"C:\watermark.png"))
{
  Parallel.ForEach(Directory.GetFiles(@"c:\input", "*.png"), (string fileName) =>
  {
    using (MagickImage image = new MagickImage(fileName))
    {
      image.Composite(watermark, CompositeOperator.Over);
      image.Write(@"c:\output\uniquefilename.png");
    }
  });
}

Viewing all articles
Browse latest Browse all 3693

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>