Issue ImageMagick-6.9.8-Q16 on win server 2012R2 .NET

痴心易碎 提交于 2019-12-11 08:07:45

问题


After downloading ImageMagick-6.9.8-Q16 from the official site of ImageMagick, i receive this error when i try to convert a file .tiff to .pdf using this command:

convert -resample 200X200 dir.tif dir.pdf

error

and when i try to run using .NET program, this command can't create a file.pdf

        ProcessStartInfo pinfo = new ProcessStartInfo();
        pinfo.UseShellExecute = false;
        pinfo.RedirectStandardOutput = true;
        pinfo.CreateNoWindow = true;
        pinfo.FileName = converterPath;
        pinfo.Arguments = "convert -resample 200X200" + dirTif+ dirPdf;


        Process proc = null;
        try
        {
            proc = Process.Start(pinfo);
            proc.WaitForExit(); 
        }
        catch (Exception ex)
        {

         serviceLogger.WriteMessage("PROCESS EXCEPTION", ex.Message + " | " + ex.StackTrace + " | " +ex.Source );
        }

How can I fix it?


回答1:


You can ignore them like this:

convert image.tif -define tiff:ignore-tags=TAG1,TAG2,TAG3 ...

If you want to check what you are ignoring first, look here to search for TIFF tags.



来源:https://stackoverflow.com/questions/44820300/issue-imagemagick-6-9-8-q16-on-win-server-2012r2-net

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!