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
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
...
Copy link to clipboard
Copied
From what I read is this link Photoshop RAW format has no header. Photoshop RAW File Format
Copy link to clipboard
Copied
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.