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

Get Print DPI Resolution?

Community Expert ,
Jun 01, 2019 Jun 01, 2019

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
1.2K
Translate
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

...
Translate
Adobe
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, "XResolution");

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

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

        }else{

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

            }

};

Translate
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
LATEST

Thank You

JJMack
Translate
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