curiouswebster
asked on
Image Magick C# Library throwing exception
Image Magick C# Library throwing exception
I suspect this is an easy one for you to help me solve.
I am trying to run a Visual Studio project that works on my friend's Windows PC, but is throwing a path/library exception on my Windows Visual Studio Community 2015,where Windows is running on my Mac via Parallels.
I verify the file exists, but then I get the following exception...
Message = "PDFDelegateFailed `The system cannot find the file specified.\r\n' @ error/pdf.c/ReadPDFImage/7 93"
and here is the code that throws it:
I suspect this is an easy one for you to help me solve.
I am trying to run a Visual Studio project that works on my friend's Windows PC, but is throwing a path/library exception on my Windows Visual Studio Community 2015,where Windows is running on my Mac via Parallels.
I verify the file exists, but then I get the following exception...
Message = "PDFDelegateFailed `The system cannot find the file specified.\r\n' @ error/pdf.c/ReadPDFImage/7
and here is the code that throws it:
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I also tried another test, based on your suggestion. I copied the entire project to my Windows partition, but found the same exact error. I wonder if I need to get something from NuGet and do a fresh install...
Any suggestion how I'd check and see about downloading Image Magick? It seems installed already...
Any suggestion how I'd check and see about downloading Image Magick? It seems installed already...
ASKER
I ran Update from ImageMagick and got errors on the Rebuild All:
Severity Code Description Project File Line Suppression State
Error CS1503 Argument 1: cannot convert from 'ImageMagick.IMagickImage' to 'ImageMagick.MagickImage' ocr.new C:\Projects\WindowsAuditAp p\SampleFi les\ocr.ne w 4\ocr.new\FredsImageMagick Scripts\Th reshold\Te xtCleaner\ TextCleane rScript.cs 198 Active
Here's the code for TextCleanerScript.cs:
public MagickImage Execute(MagickImage input)
{
if (input == null)
throw new ArgumentNullException("inp ut");
CheckSettings();
var output = input.Clone();
RotateImage(output); >>> LINE 198 <<<<
CropImage(output);
ConvertToGrayscale(output) ;
EnhanceImage(output);
RemoveNoise(output);
UnrotateImage(output);
SharpenImage(output);
SaturateImage(output);
AdaptiveBlurImage(output);
TrimImage(output);
PadImage(output);
return output;
}
Severity Code Description Project File Line Suppression State
Error CS1503 Argument 1: cannot convert from 'ImageMagick.IMagickImage'
Here's the code for TextCleanerScript.cs:
public MagickImage Execute(MagickImage input)
{
if (input == null)
throw new ArgumentNullException("inp
CheckSettings();
var output = input.Clone();
RotateImage(output); >>> LINE 198 <<<<
CropImage(output);
ConvertToGrayscale(output)
EnhanceImage(output);
RemoveNoise(output);
UnrotateImage(output);
SharpenImage(output);
SaturateImage(output);
AdaptiveBlurImage(output);
TrimImage(output);
PadImage(output);
return output;
}
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I will give that a try. Thanks.
Did you find the problem?
ASKER
No. I have a short desktop share planned with my developer. After that, if no success, I will follow your advice.
May I suggest that we unmark my comment as the answer in the meantime? While I appreciate the points, this is a good problem that someone else might have in the future, so I want to ensure that the final answer is able to help those people.
ASKER
Ok, I did that. Thanks.
Thanks! :)
ASKER
The problem turned out to be the wrong version of the DLL for a library. I can close this question, but I still found your debugging solution to be useful.
Glad it helped!
ASKER
Can I assign you the winner, but give you zero points, at least?
If the debugging helped lead you to the solution, you can give that comment the points. Otherwise, you can accept multiple answers and choose both your answer (and give it the points) and then my comments (with zero points) as the solution.
ASKER
thanks
ASKER