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

Get Print DPI Resolution?

Community Expert ,
Jun 01, 2019 Jun 01, 2019

Copy link to clipboard

Copied

In Windows File explorer I can right click on an image file and click on properties. In the Properties window details tab in the image section see the Images Print resolution setting.  Is there any way with javascript  to get this Print DPI resolution without opening the image file in Photoshop?

Capture.jpg

JJMack
TOPICS
Actions and scripting

Views

983

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

Guide , Jun 01, 2019 Jun 01, 2019

#target photoshop;

main();

function main(){

var file = File.openDialog("Please select JPG file.","JPG File:*.jpg");

if (file == null) return;

if ( !ExternalObject.AdobeXMPScript ) ExternalObject.AdobeXMPScript = new ExternalObject('lib:AdobeXMPScript');

        var xmpf = new XMPFile( File(file).fsName, XMPConst.UNKNOWN, XMPConst.OPEN_FOR_READ );

        var xmp = xmpf.getXMP();

        if(xmp.doesPropertyExist(XMPConst.NS_TIFF, "XResolution")){

        var res = xmp.getProperty(XMPConst.NS_TIFF, "XResol

...

Votes

Translate

Translate
Adobe
Guide ,
Jun 01, 2019 Jun 01, 2019

Copy link to clipboard

Copied

#target photoshop;

main();

function main(){

var file = File.openDialog("Please select JPG file.","JPG File:*.jpg");

if (file == null) return;

if ( !ExternalObject.AdobeXMPScript ) ExternalObject.AdobeXMPScript = new ExternalObject('lib:AdobeXMPScript');

        var xmpf = new XMPFile( File(file).fsName, XMPConst.UNKNOWN, XMPConst.OPEN_FOR_READ );

        var xmp = xmpf.getXMP();

        if(xmp.doesPropertyExist(XMPConst.NS_TIFF, "XResolution")){

        var res = xmp.getProperty(XMPConst.NS_TIFF, "XResolution");

        res = res.toString().split("/");

        alert(res[0]/res[1]);

        }else{

            alert("No resolution, default 72ppi");

            }

};

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 ,
Jun 01, 2019 Jun 01, 2019

Copy link to clipboard

Copied

LATEST

Thank You

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