I am trying to grab an image from my network and resize and rename with image magic.
When I use the following commands it works.
convert.exe -resize 588x420 \\ut02\pics-dotnet\images\DealerCMO\Cash_For_Cars\Cash_For_Cars\Images\cl_upload\YV1AS982491100676\1.jpg "X:\ZCL_Poster\Production\CA-SFBay\ctd-CA-SFBay-eby-1\Images\expl blac padd fourt 5864.jpg"
this tells image magic to convert with resize the file from \\ut02 to X: ( local project directory) image folder and new name.
this works perfect when pasted to cmd window. Requirres the " around last file" as it can contain spaces.
Now the C# I am using is as follows
string strCmdText= "/c convert.exe -resize" 600x450 \\\\ut02\\pics-dotnet\\images\\DealerCMO\\Cash_For_Cars\\Cash_For_Cars\\Images\\cl_upload\\YV1AS982491100676\\1.jpg \"X:\\ZCL_Poster\\Production\\CA-SFBay\\ctd-CA-SFBay-eby-1\\Images\\expl blac padd fourt 5864.jpg\"";
System.Diagnostics.Process.Start("CMD.exe",strCmdText);
this works fine. and makes the same image from the C# block.
the Quotes around the second file have to be escaped, and so to all the \
the problem is now turning them into variables
anytime I try to make the 2 paths into a variable it fails.
I think the issues in the last file argument being in quotes.
I have tried this, and it fails too
string localpath = "project.Variables['Image_LocalFullPath'].Value";
string size = "project.Variables['Image_Resize'].Value";
string origpath = "project.Variables['Image_OrigPath'].Value";
string strCmdText= "/c convert.exe -resize" + size + origpath + \"localpath\"";
System.Diagnostics.Process.Start("CMD.exe",strCmdText);
It apears that this is no longer interpretted as a variable
\"localpath\"
but it has to have quotes around it to the cmd
also don't know if I need the files to be escaped or not inside the variable, tried it both ways and both failed
Please help
When I use the following commands it works.
convert.exe -resize 588x420 \\ut02\pics-dotnet\images\DealerCMO\Cash_For_Cars\Cash_For_Cars\Images\cl_upload\YV1AS982491100676\1.jpg "X:\ZCL_Poster\Production\CA-SFBay\ctd-CA-SFBay-eby-1\Images\expl blac padd fourt 5864.jpg"
this tells image magic to convert with resize the file from \\ut02 to X: ( local project directory) image folder and new name.
this works perfect when pasted to cmd window. Requirres the " around last file" as it can contain spaces.
Now the C# I am using is as follows
string strCmdText= "/c convert.exe -resize" 600x450 \\\\ut02\\pics-dotnet\\images\\DealerCMO\\Cash_For_Cars\\Cash_For_Cars\\Images\\cl_upload\\YV1AS982491100676\\1.jpg \"X:\\ZCL_Poster\\Production\\CA-SFBay\\ctd-CA-SFBay-eby-1\\Images\\expl blac padd fourt 5864.jpg\"";
System.Diagnostics.Process.Start("CMD.exe",strCmdText);
this works fine. and makes the same image from the C# block.
the Quotes around the second file have to be escaped, and so to all the \
the problem is now turning them into variables
anytime I try to make the 2 paths into a variable it fails.
I think the issues in the last file argument being in quotes.
I have tried this, and it fails too
string localpath = "project.Variables['Image_LocalFullPath'].Value";
string size = "project.Variables['Image_Resize'].Value";
string origpath = "project.Variables['Image_OrigPath'].Value";
string strCmdText= "/c convert.exe -resize" + size + origpath + \"localpath\"";
System.Diagnostics.Process.Start("CMD.exe",strCmdText);
It apears that this is no longer interpretted as a variable
\"localpath\"
but it has to have quotes around it to the cmd
also don't know if I need the files to be escaped or not inside the variable, tried it both ways and both failed
Please help