I have a collection of images I need to convert to PNG, then to Base64. Iterating through the collection one at a time takes about a second per image for the conversion to string. I tried to use PLINQ to do the conversion like this:
An exception of type 'System.ArgumentNullException' occurred in GraphicsMagick.NET-AnyCPU.dll but was not handled in user code
Value cannot be null.\r\nParameter name: inArray
Can parallelism be used with MagicImageCollection? and if not, does anyone know of a way to make that conversion to base64 faster?
returnImage.AsParallel().ForAll(test => test.Format=MagickFormat.Png);
returnImage.AsParallel().AsOrdered().ForAll(test => test.ToBase64());
And the setting to PNG works fine, the ToBase64 throws an error:An exception of type 'System.ArgumentNullException' occurred in GraphicsMagick.NET-AnyCPU.dll but was not handled in user code
Value cannot be null.\r\nParameter name: inArray
Can parallelism be used with MagicImageCollection? and if not, does anyone know of a way to make that conversion to base64 faster?