• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Open raw file in photoshop JavaScript CameraRAWOpenOptions() setting exposure does not work

New Here ,
Nov 06, 2022 Nov 06, 2022

Copy link to clipboard

Copied

I have a JavaScript that opens the RAW file and adjusts the intake options like tint, temperature, and exposure. The settings for adjustment to tint, and temperature properties work fine but not the exposure does not. here is my code:

    var strPath = "G:\\images\\Current\\_MG_"+ index +".CR2";
    var OpenOptions = new CameraRAWOpenOptions()
   
    OpenOptions.temperature = temperature
    OpenOptions.tint = tint
    OpenOptions.exposure = exposure
 
    app.displayDialogs = displayDialogs
    app.open( new File( strPath ),  OpenOptions)

Any suggestions? 
TOPICS
Actions and scripting , Windows

Views

289

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Advisor ,
Nov 06, 2022 Nov 06, 2022

Copy link to clipboard

Copied

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 06, 2022 Nov 06, 2022

Copy link to clipboard

Copied

It might help to post the full script. For example, what is the exposure variable value?

 

EDIT: I just tried with a valid hard-coded value and I can reproduce the issue.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Nov 07, 2022 Nov 07, 2022

Copy link to clipboard

Copied

I tried - it doesn't work either. In this case, the ActionManager code works properly.

var c2t = charIDToTypeID,
    s2t = stringIDToTypeID;

var d = new ActionDescriptor();
var params = new ActionDescriptor();

d.putPath(s2t("null"), new File("G:\\images\\Current\\_MG_" + index + ".CR2"));
params.putInteger(c2t("Temp"), temperature);
params.putInteger(c2t("Tint"), tint);
params.putDouble(c2t("Ex12"), exposure);
d.putObject(s2t("as"), s2t("Adobe Camera Raw"), params);
executeAction(s2t("open"), d, DialogModes.NO);

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 08, 2022 Nov 08, 2022

Copy link to clipboard

Copied

@defaultxu9xtaayqx03 – So how did you go with the code posted from @jazz-y ?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 21, 2022 Dec 21, 2022

Copy link to clipboard

Copied

LATEST

Same here. 

 

I am writing a script to show a side-by-side before/after the edit, and I cannot load the RAW image with all parameters reset.

 

The code works when I change the CameraRAWOpenOptions.settings to "CameraRAWSettingsType.CAMERA", but the problem is that I need to keep the crop and transform image after the edit, so the framing of both the before and after matches.

 

Here is my try:

#target photoshop

 

openUneditedRAW(activeDocument);
 
function openUneditedRAW(selectedDocument) {
    selectedFile = new File(selectedDocument.fullName);
    var openRAWOptions = new CameraRAWOpenOptions();

    // Settings
    openRAWOptions.settings = CameraRAWSettingsType.CUSTOM;
    openRAWOptions.whiteBalance = WhiteBalanceType.ASSHOT;
    openRAWOptions.exposure = 0;
    openRAWOptions.shadows = 0;
    openRAWOptions.brightness = 0;   
    // All the available settings reseted.

    var uneditedDocument = open(selectedFile, openRAWOptions, true);
}
 
I would use the approach proposed by jazz-y, but I am new to scripting, and the Action Manager doesn't look particularly friendly.
 
Any help?
 
Kind regards,

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines