Copy link to clipboard
Copied
Hello everybody,
I'm running a windows-service using Adobe PShop CS 3 for graphics conversion.
But for some graphics my conversion fails. I figured out that the problem is the Colormode.
If its set to RGB everything is fine but when the source-graphic has colormode bitmap it fails.
now I have to convert every graphic to rgb before conversion. I found the changeMode() method in the photoshop interop package, but theres a problem with the second parameter :
mobjDoc.ChangeMode(PsChangeMode.psConvertToRGB, Object Options)
How to build a proper options-Object for this command?
and is there any API or something similar for the Photoshop.Interop
A fallback solution would be scripting with the conditional mode change script. but I have no idea to implement it in a propoer way so no user interaction is needed.
A other fallback solution would be the save for web option or saveAS jpeg.... but there is no save for web method in c# and the saveAS could not save as jpeg 😞
thanks in advandce
Best regards
Moritz
Copy link to clipboard
Copied
You shold only need the second argument to changeMode if you are converting to bitmapped or indexed color images.
-X
Copy link to clipboard
Copied
i think you got me wrong.
i need to know what object to pass to the method. and how to build it.
e.g.:
SerchedObject myObject = new SearchedObject();
myObject.setParam1 = true;
myObject.setParam2 = whatever;
myPicture.ChangeMode(PsChangeMode.psConvertToRGB, myObject);
....
I also tried this with no result:
myPicture.ChangeMode(PsChangeMode.psConvertToRGB, null);
Copy link to clipboard
Copied
If you are converting to RGB, there is no second object to pass. I have no idea how to express that in C#. In JS, you either don't put anything or you pass undefined which is almost the same as null.
-X
Copy link to clipboard
Copied
I've tried with the null parameter. My Errorlog shows following:
General Photoshop error occurred.- Der Befehl "Konvertierungsmodus" ist zzt. nicht verfügbar.
in english something like:
General Photoshop error occurred.-the command "ConvertMode" is currently not available
Copy link to clipboard
Copied
What's the original mode and bit depth of the document? Can you convert it manually?
Copy link to clipboard
Copied
Originalmode ist bitmap and is none given. the controls at picture -> mode -> 8-bit / 16-bit are greyed out.
I can convert it manualy with the conditional mode change automatisation or save for web as jpeg.
Copy link to clipboard
Copied
Well I solved it but a little bit different.
I used the scriptlistener to record a conversion of a sample file. then used the minimal customized log-file as JS script called via .DoJavaScriptFile(..).
Thank you for your help