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

Image resolution in InDesign CS4 js

Participant ,
Sep 28, 2010 Sep 28, 2010

Hi, is it possible to find out image resolution directly from InDesign, or do I have to open the file in Photoshop to do it.

Thank you.

Yulia

TOPICS
Scripting
2.0K
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
Valorous Hero ,
Sep 28, 2010 Sep 28, 2010

var doc = app.activeDocument;
var graphics = doc.allGraphics;

var image, horRes, verRes;

for (var i = 0; i < graphics.length; i++) {
     image = graphics;
     try {
          // The resolution of a graphic after it has been resized.
          horEffRes = Math.round(image.effectivePpi[0]);
          verEffRes = Math.round(image.effectivePpi[1]);
          // The native resolution of a placed graphic.
          horActRes = Math.round(image.actualPpi[0]);
          verActRes = Math.round(image.actualPpi[1]);
          $.writeln((i+1) + " - " + image.itemLink.name);
          $.writeln("Effective resolution - " + horEffRes + "x" + verEffRes + " ppi");
          $.writeln("Actual resolution - " + horActRes + "x" + verActRes + " ppi");
     }
     catch (err) {
          // vector graphic
          $.writeln((i+1) + " - " + image.itemLink.name + " - Resolution is unavailable");
     }
}

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
Participant ,
Sep 29, 2010 Sep 29, 2010

Got it, thank you.

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
Engaged ,
Jul 31, 2017 Jul 31, 2017
LATEST

You should also mark correct answer!

-Sumit
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