2 Replies Latest reply on Apr 12, 2012 10:32 AM by msabeln

    How do I generate a report showing exact image sizes?

    msabeln

      I was directed here from the general InDesign forum.

       

      My publisher uses InDesign for creating books. I do not own the product, as I can't justify the cost at this time.

       

      I provided the photography for this book, and I need to accurately determine the image sizes that he used, so that I can use Photoshop to edit them to look best at the sizes used in the publication.

       

      Is there a report that he can generate from InDesign, which will give me the image names along with the final image dimensions? I'd rather not go to his office and write all this down manually, as there are hundreds of photos I need to process.

       

      I am hoping that perhaps someone has already written a script that can do this, or knows of a free tool that can help me out.

        • 1. Re: How do I generate a report showing exact image sizes?
          [Jongware] Most Valuable Participant

          Well, since no-one else reacted let me have a go at it ...

           

          Here is a Javascript that lets you save a report for all used image file names and the size of the rectangle it is placed in (note that it is possible this is not the "image size used"!).

           

          //DESCRIPTION:Write image size report
          // A Jongware Script 12-Apr-2012
          res = [];
          imgs = app.activeDocument.allGraphics;
          unitname = getCurrentUnit();
          for (i=0; i<imgs.length; i++)
          {
            h = imgs[i].parent.geometricBounds[2] - imgs[i].parent.geometricBounds[0];
            w = imgs[i].parent.geometricBounds[3] - imgs[i].parent.geometricBounds[1];
            // some fair rounding
            switch (unitname)
            {
              case 'in': w = w.toFixed(3); h = h.toFixed(3); break;
              case 'cm': w = w.toFixed(2); h = h.toFixed(2); break;
              default: w = w.toFixed(1); h = h.toFixed(1);
            }
            res.push (imgs[i].itemLink.name+'\t'+w+' x '+h+' '+unitname);
          }
          defaultFile = new File (Folder.myDocuments+"/"+app.activeDocument.name.replace(/\.indd$/i, '')+".txt");
          if (File.fs == "Windows")
            writeFile = defaultFile.saveDlg( 'Save report', "Plain text file:*.txt;All files:*.*" );
          else
            writeFile = defaultFile.saveDlg( 'Save report');
          if (writeFile != null)
          {
            if (writeFile.open("w"))
            {
              writeFile.encoding = "utf8";
              writeFile.write (res.join("\r")+"\r");
              writeFile.close();
            }
          }
          function getCurrentUnit ()
          {
            switch (app.activeDocument.viewPreferences.horizontalMeasurementUnits)
            {
              case MeasurementUnits.POINTS: return "pt";
              case MeasurementUnits.PICAS: return "pt";
              case MeasurementUnits.INCHES: return "in";
              case MeasurementUnits.INCHES_DECIMAL: return "in";
              case MeasurementUnits.MILLIMETERS: return "mm";
              case MeasurementUnits.CENTIMETERS: return "cm";
              case MeasurementUnits.CICEROS: return "c";
              case MeasurementUnits.AGATES: return "ag";
              default: alert ("Oh, come on!"); exit(0);
            }
          }
          
          1 person found this helpful
          • 2. Re: How do I generate a report showing exact image sizes?
            msabeln Level 1

            Thank you very much for your effort! I will visit my publisher and try this script.