3 Replies Latest reply on Jul 31, 2017 7:17 AM by Oriup

    Image resolution in InDesign CS4 js

    Yuliaart

      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

        • 1. Re: Image resolution in InDesign CS4 js
          Kasyan Servetsky Level 5

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

          var image, horRes, verRes;

          for (var i = 0; i < graphics.length; i++) {
               image = graphics[i];
               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");
               }
          }

          • 2. Re: Image resolution in InDesign CS4 js
            Yuliaart Level 1

            Got it, thank you.

            • 3. Re: Image resolution in InDesign CS4 js
              Oriup Level 1

              You should also mark correct answer!