Hi Bernd,
the following works for me:
readImage = function( filePath )
{
var suffix = File.extractExtension( filePath ).toLowerCase();
var F = new FileFormat( suffix, true/*toRead*/, false/*toWrite*/ );
if ( F.isNull )
throw new Error( "No installed file format can read \'" + suffix + "\' files." );
var f = new FileFormatInstance( F );
if ( f.isNull )
throw new Error( "Unable to instantiate file format: " + F.name );
var d = f.open( filePath, "" );
if ( d.length < 1 )
throw new Error( "Unable to open file: " + filePath );
if ( d.length > 1 )
throw new Error( "Multi-image files are not supported by this script: " + filePath );
Console.writeln("keywords");
Console.writeln(f.keywords);
return;
};
readImage("D:/Users/Public/Pictures/Astro/2016_10_01_LaPalma/20161005_Packman_Georg/light_packman (1).CR2")
Output:
run --execute-mode=auto "D:/Users/Georg/PixInsight/NewScriptFile1.js"
Processing script file: D:/Users/Georg/PixInsight/NewScriptFile1.js
keywords
{COMMENT,,Decoded with PixInsight 01.08.04.1195},{COMMENT,,Decoded with DSLR_RAW module 01.03.05.0324},{COMMENT,,Decoded with dcraw version 9.27},{INSTRUME,Canon EOS 80D,Camera model},{DATE-OBS,2016-10-05T21:44:59,Camera timestamp},{EXPTIME,29.900000,Exposure time in seconds},{ISOSPEED,800,ISO speed as specified in ISO 12232}
Georg