2 Replies Latest reply on Aug 17, 2016 12:18 PM by cchimi

    Avoid "reading" images

    cchimi Level 2

      I have a script that inserts images throughout a document and applies an object style to them. I've found that once the script is done, it takes time to visit any page in the document that has these images. I see a little blue bar appear at the bottom of the ID window that says "Reading [image name]". It will read each image on the spread before it takes me there. Once the images on a particular spread have been read, I can revisit that spread with no lag. Also, if I don't visit any pages but save the document and reopen it (or save a copy and open it) I can visit any page normally, with no lag. Obviously ID needs to do some sort of one-time scan of the images I've placed, but I'd much prefer to handle this as part of the script and not inconvenience users with it. Since it happens automatically on save, I wonder if there's some way to mimic it in a script without saving the document? From what I can tell, this only happens when an object style is applied to images.


      I've tried recomposing the story after placing each image, but it has no effect on this issue. Any thoughts on an approach that might work here?

        • 1. Re: Avoid "reading" images
          Laubender Adobe Community Professional & MVP

          I can only suspect what's going on since you provided no code and/or a test document.
          First off, some questions:


          What is your exact version of InDesign on what OS and on what machine?


          It could be, that inDesign is calculating the proxy images for the placed graphics if you visit a spread the first time.
          And that is taking its time. Could that be the case here?



          • 2. Re: Avoid "reading" images
            cchimi Level 2

            ID CC 2015.4 Release

   x64 Build

            Windows 10


            I don't know if code snippet would be too helpful, but here's a very slimmed down one (this assumes the insertion point for the graphic (myRng) has already been determined and the graphic file itself (myFile) selected - most of the code is wrapped up in working out those two things).


            var myRect = myRng.rectangles.add();
            var myImg = myRect.place(myFile);
            myRng.contents = "";


            I had thought that it only occurred when an object style was applied, but that doesn't seem to be the case. I've also cut the document down to just 5 pages and half a dozen images - same behavior (although perhaps a bit less lag time).


            Your theory is good and makes sense to me. I wish I could test it, but changing the Display Performance to Fast rather than Typical has no effect on the images. They are EPS images, and I've double-checked that they are set to grey out on Fast. But, it doesn't happen. I also can't apply it locally via an everyItem() scripting command; the only way I can get the images to grey out is by selecting them manually and giving them a Fast Display Performance - but at that point they've already been "read" so it doesn't tell me anything.


            Unless anyone has a different insight, I'll probably assume you're right and that it's not fixable.