Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


How to add a header to PhotoshopRAW file format ?

Engaged ,
Jun 25, 2020 Jun 25, 2020

Copy link to clipboard

Copied

I need to add a header to PhotoshopRaw files I'm writing but have found no information on how it is done.  There is a parameter to specify the header length  N (in bytes I guess) but does the header overlay the first N bytes or is it before the start of the file making the file width X height X number of channels X bytes per channel + N in length.

 

Thanks,

RONC

TOPICS
Actions and scripting, SDK

Views

126

Likes

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

correct answers 1 Correct answer

Adobe Community Professional , Jul 12, 2021 Jul 12, 2021
try this AM code function save_as_raw(file, hdr_len) { try { var d = new ActionDescriptor(); var d1 = new ActionDescriptor(); d1.putString(stringIDToTypeID("fileCreator"), "8BIM"); if (hdr_len) d1.putInteger(stringIDToTypeID("header"), hdr_len); d1.putBoolean(stringIDToTypeID("channelsInterleaved"), true); d1.putEnumerated(stringIDToTypeID("byteOrder"), stringIDToTypeID("platform"), stringIDToTypeID("IBMPC")); d.putObject(st...

Likes

Translate

Translate
Adobe Community Professional ,
Jul 12, 2021 Jul 12, 2021

Copy link to clipboard

Copied

From what I read is this link Photoshop RAW format has no header. Photoshop RAW File Format

JJMack

Likes

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 Community Professional ,
Jul 12, 2021 Jul 12, 2021

Copy link to clipboard

Copied

LATEST

try this AM code

 

 

 

function save_as_raw(file, hdr_len)
    {
    try {
        var d = new ActionDescriptor();
        var d1 = new ActionDescriptor();
        d1.putString(stringIDToTypeID("fileCreator"), "8BIM");
        if (hdr_len) d1.putInteger(stringIDToTypeID("header"), hdr_len);  
        d1.putBoolean(stringIDToTypeID("channelsInterleaved"), true);
        d1.putEnumerated(stringIDToTypeID("byteOrder"), stringIDToTypeID("platform"), stringIDToTypeID("IBMPC"));
        d.putObject(stringIDToTypeID("as"), stringIDToTypeID("rawFormat"), d1);
        d.putPath(stringIDToTypeID("in"), file);
        d.putBoolean(stringIDToTypeID("copy"), true);
        d.putBoolean(stringIDToTypeID("spot"), false);
        d.putBoolean(stringIDToTypeID("alphaChannels"), false);
        executeAction(stringIDToTypeID("save"), d, DialogModes.NO);
        }
    catch (e) { throw(e); }
    }

 

 

UPD.

The header (zeros) will be at the beginning of the file. I have so. Why this header I do not know.

 

Likes

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