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

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

374

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

People's Champ , 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
...

Votes

Translate

Translate
Adobe
Community Expert ,
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

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
People's Champ ,
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.

 

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