Link to home
Start Free TrialLog in
Avatar of curiouswebster
curiouswebsterFlag for United States of America

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/793"

User generated image
and here is the code that throws it:

User generated image
ASKER CERTIFIED SOLUTION
Avatar of gr8gonzo
gr8gonzo
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of curiouswebster

ASKER

I created a local folder on the C: drive but got the same error...

User generated image
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...

User generated image
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\WindowsAuditApp\SampleFiles\ocr.new 4\ocr.new\FredsImageMagickScripts\Threshold\TextCleaner\TextCleanerScript.cs      198      Active

Here's the code for TextCleanerScript.cs:
public MagickImage Execute(MagickImage input)
    {
      if (input == null)
        throw new ArgumentNullException("input");

      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
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I will give that a try. Thanks.
Did you find the problem?
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.
Ok, I did that. Thanks.
Thanks! :)
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!
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.
thanks