15 Replies Latest reply on Jun 25, 2016 7:54 AM by Obi-wan Kenobi

    Change image width

    mirza h

      Hello,

       

      ID CC 2015 here. I worked on two column book which contains a lot of images. Now, I need to do three column version and need to change width of all images to size corresponding column width (43,3mm). Is there any way (script or something) to change width of the all images in document to fixed size and keep aspect ratio, other than click each image and manually enter new value?

       

      thanks!

        • 1. Re: Change image width
          Salah Fadlabi Level 5

          Try: layout>margins and columns>check on enable adjustment layout

          • 2. Re: Change image width
            BarbBinder Adobe Community Professional

            I agree with Salah: start with layout adjustment. If that works, great!l That's the way we did it for years. The checkbox is still in CC but the controls have been removed.

             

            If that doesn't work for you, the newer approach is to set up liquid layout rules that tell the frames how to behave when the page layout is updated. It takes more effort, but in the end provides more control over the updated spreads.

             

            Liquid and alternate layouts in InDesign

            • 3. Re: Change image width
              mirza h Level 1

              Thanks for replay, but I'm trying to change all images width size in document not column width size.

              • 4. Re: Change image width
                BarbBinder Adobe Community Professional

                Both of these approaches allow InDesign to resize the image frames to match the new column widths.

                Now, I need to do three column version and need to change width of all images to size corresponding column width (43,3mm).

                We both forgot to say that the image fitting should be set to Auto-Fit for each image.

                • 5. Re: Change image width
                  Salah Fadlabi Level 5

                  Without enable adjustment apply to master page

                  a.jpg

                  Apply adjustment to master page

                  b.jpg

                  The result

                  c.jpg

                  • 6. Re: Change image width
                    mirza h Level 1

                    Thanks for replays.

                     

                    Sorry, but I'm still failing to see how layout adjustments changes could effect image size in documents.

                     

                    I have two column document like in image below:

                     

                    two columns.jpg

                     

                    When I change it to three column, images remain their sizes and it is look like this:

                     

                    three columns.jpg

                    Since there is almost 1000 these images it would be great if there is some sort of automatic way to resize images  so they fits column.

                     

                    thanks!

                    • 7. Re: Change image width
                      jane-e Adobe Community Professional

                      mirza h wrote:

                       

                      Thanks for replays.

                       

                      Sorry, but I'm still failing to see how layout adjustments changes could effect image size in documents.

                       

                      I have two column document like in image below:

                       

                       

                      When I change it to three column, images remain their sizes and it is look like this:

                       

                      Since there is almost 1000 these images it would be great if there is some sort of automatic way to resize images so they fits column.

                       

                      thanks!

                      Please post two screen shots so we can troubleshoot:

                       

                      1. Select an image and show what you have for Frame Fitting Options.

                       

                      2. Show your Margins and Columns dialog box

                      You can paste into this window.

                      • 8. Re: Change image width
                        Obi-wan Kenobi Adobe Community Professional

                        Hi,

                         

                        Try this:

                         

                        if (app.documents.length == 0) {  
                             alert("No documents are open. Please open a document and try again.");  
                        }  
                        else {  
                             Main();  
                        }  
                          
                        function Main() {  
                             var doc = app.activeDocument;  
                             var images = doc.allGraphics;  
                          
                             var savedHorizontalMeasurementUnits = doc.viewPreferences.horizontalMeasurementUnits;  
                             var savedVerticalMeasurementUnits = doc.viewPreferences.verticalMeasurementUnits;  
                             doc.viewPreferences.horizontalMeasurementUnits = MeasurementUnits.MILLIMETERS;  
                             doc.viewPreferences.verticalMeasurementUnits = MeasurementUnits.MILLIMETERS;  
                          
                             for (var i = 0; i < images.length; i++) {  
                                  var image = images[i];  
                                  var rec = image.parent;  
                                  var gb = rec.geometricBounds;  
                                  var width = gb[3] - gb[1];  
                                  var scale = 43.3/width;  
                               
                                  var myTransformationMatrix =  app.transformationMatrices.add({horizontalScaleFactor:scale, verticalScaleFactor:scale});   
                                  rec.transform(CoordinateSpaces.pasteboardCoordinates, AnchorPoint.CENTER_ANCHOR, myTransformationMatrix);   
                             }  
                          
                             doc.viewPreferences.horizontalMeasurementUnits = savedHorizontalMeasurementUnits;  
                             doc.viewPreferences.verticalMeasurementUnits = savedVerticalMeasurementUnits;  
                          
                             alert("Done");  
                        }  
                        
                        2 people found this helpful
                        • 9. Re: Change image width
                          jane-e Adobe Community Professional

                          Obi-wan Kenobi wrote:

                           

                          Hi,

                           

                          Try this:

                           

                          1. if(app.documents.length==0){
                          2. alert("Nodocumentsareopen.Pleaseopenadocumentandtryagain.");
                          3. }

                          Obi-wan,

                          Are you going to MAX? I want to meet you!!!

                          • 10. Re: Change image width
                            mirza h Level 1

                            1. Frame fitting:

                             

                             

                            2. Margins and Columns:

                             

                            • 11. Re: Change image width
                              mirza h Level 1

                              Obi-wan,

                               

                              That's it! Thanks a lot, Sir!

                              • 12. Re: Change image width
                                Obi-wan Kenobi Adobe Community Professional

                                I'm living on tatooine, in a galaxy far far away! … So, no! I won't go to MAX!  ;-)

                                • 13. Re: Change image width
                                  jane-e Adobe Community Professional

                                  Yes, should have known—Tatooine...

                                  • 14. Re: Change image width
                                    Peter Spier Most Valuable Participant (Moderator)

                                    Your internet service seems pretty fast for intergalactic...

                                    • 15. Re: Change image width
                                      Obi-wan Kenobi Adobe Community Professional

                                      Aha! I use The Force!