Skip to main content
Inspiring
December 5, 2018
Question

Resize image to fit frame

  • December 5, 2018
  • 2 replies
  • 2760 views

Hi,

I want to resize the image and fit into the overflow/overset frames using indesign script

and how resize the image into frame size then fit?

pls help

This topic has been closed for replies.

2 replies

Community Expert
December 6, 2018

Search the forum.

I think, we already had this question some months ago and it was answered sufficiently.

Regards,
Uwe

heatherw6960836
Inspiring
August 9, 2019

This is what I used (JSX Script)

fitImagesToFrame(); 

 

function fitImagesToFrame(){ 

    var allLinks = app.activeDocument.links; 

    for(var i=0;i<allLinks.length;i++){ 

           var myImage = app.activeDocument.links.parent;

           myImage.fit(FitOptions.FILL_PROPORTIONALLY);  // fill frame proportionally

           //myImage.fit(FitOptions.PROPORTIONALLY); // fit frame proportionally

    }

    alert("Images have been fitted (Fill Proportionally).");

}

Community Expert
August 10, 2019

Hi heatherw6960836 ,

hm. Perhaps it would be better to work with the document.allGraphics array.

There could be text files linked as well. And it could be that some graphics are not linked at all.

FWIW: I'm not clear at all what the OP exactly wants:

…and how resize the image into frame size then fit?

That would require a text frame where the anchored image is resized to fit the width ( ? ) of the frame.

I'm not sure about that. If the anchored image is in overset there is no frame to fit the width or height.

It's also unclear if then the anchored image in overset should fit the last text frame of the story.

Whether in width, in height or both is also unclear.

So a first step could be to clear overset by either expanding the last text frame of the story or do a new text frame and thread it to the last frame of the story. However, if the cause of the overset is the anchored image I would suggest to "move" it out of the frame either by using a different anchoring method or by moving it to a new insertion point of a frame that is big enough to hold it.

Then it could be resized and later be tested if the story where it was positioned in will still go to overset if it is anchored the same way than before.

Complex cases.

Unfortunately we have no details ;-)

The OP never came back. :-(

Regards,
Uwe

Community Expert
December 6, 2018

Do you mean to say that your document has frames that has text and images in it and some of them have overset. So you need a code to find frames with overset and if there is any image in it then resize the image to remove the overset? What is the logic you would want to resize the image?

Please elaborate on the issue

-Manan

-Manan