Apr 27, 2015 at 7:46 AM
Edited Apr 27, 2015 at 8:44 AM
I built a small Windows Forms application to test the image conversion and the result looks just fine (after changing he color space).
My investigation so far:
Regarding the exception:
- The images looks fine in older version
- The same code produces a white square (no image) in new version
- After changing the color space the image looks fine in test application with new version
- After changing the color space the image looks washed out in real application with new version (might be caused by iTextSharp after changing the color space of the image)
The exceptions is thrown from the line:
var mi = new MagickImage(path, settings);
This method is called upon only if (File.Exists(path)) so the error message "`The system cannot find the file specified.
' @ error/ps.c/ReadPSImage/951" should not refere to the image file, event though it looks like it.
It seems like this error only occurs when severeal threads are working simultaneously, whick makes it kind of interesting since it works fine in the older version.
After some more testing I can clearly se a pattern that the never version of Magick.NET have issues with multi-threading.
The exception above ONLY occurs when trying calling new MagickImage(path, settings) from more than one thread
ImageMagick.MagickDelegateErrorException: Typography.GUI.vshost.exe: FailedToExecuteCommand `"gs" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pngalpha" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-r300x300" -g3389x1335 -dEPSCrop "-sOutputFile=C:/Users/A045408/AppData/Local/Temp/magick-1348Hxy6ICAUNRYj%d" "-fC:/Users/A045408/AppData/Local/Temp/magick-1348VQD-x3Xpy-8x" "-fC:/Users/A045408/AppData/Local/Temp/magick-1348uscbvgqUp7aR"' (The system cannot find the file specified.
) @ error/delegate.c/ExternalDelegateCommand/481
--- End of inner exception stack trace ---
at ImageMagick.Wrapper.MagickImage.HandleException(MagickException exception)
at ImageMagick.Wrapper.MagickImage.Read(String fileName, MagickReadSettings readSettings)
at ImageMagick.MagickImage.Read(String fileName, MagickReadSettings readSettings)
at ImageMagick.MagickImage.Read(FileInfo file, MagickReadSettings readSettings)
at ImageMagick.MagickImage..ctor(FileInfo file, MagickReadSettings readSettings)
at Typography.Core.TypographyHelper.GetVectorImage(String path, Single density) in c:\Projects\SEMAL-TypoGraphy\Typography.Core\TypographyHelper.cs:line 539}