Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
4

Object style that gives images all the same width but also the accompanying height

Explorer ,
Apr 03, 2024 Apr 03, 2024

Dear all,

I'm designing a book with numerous images, all of different sizes.

All images will get the same width: 130 mm.

I want to make an object style that makes them 130 mm wide and gives every object the accompanying height automaticly.

It all works except for the height, the object remains smaller than the height of te image.

 

What am I missing here?

Thank you, C

 

 

TOPICS
How to , Scripting
152
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 12, 2024 Apr 12, 2024

How many differing sizes (height) do you have? Make an object style for each one if it is only a few different depths.

Better, plan your Photoshop editing work to put images into one or more known ratios/sizes; so that you deliberately limit the variety of depths. Don't allow it to be random depth sizes.

InDesign textframes can auto-adjust to different dimensions, like depth, but image frames do not do that. You could define the Size and Position to Width Only at 130mm and set the Frame Fitting Options to Fill Frame Proportionately. Lastly, you would *work-around* by double-clicking the bottom-center bounding box handle, causing the image frame to expand downwards to show the whole picture.

Mike Witherell
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 12, 2024 Apr 12, 2024
LATEST

Hi @Caro31217572wgdd , I’m not sure you could do this reliably with an Object Style. It can be scripted—this would place an image on the active page with its width at 130mm. You could give it a key command:

 

Screen Shot.png

 

 

placeSize(130)

function placeSize(pw){
    app.scriptPreferences.measurementUnit = MeasurementUnits.MILLIMETERS;
    var f = File.openDialog("Select the file", "");
    if (f!=null) {
        var img = app.activeWindow.activePage.place(File(f))[0];
        var aw = img.geometricBounds[3]-img.geometricBounds[1];
        img.transform(CoordinateSpaces.innerCoordinates, AnchorPoint.TOP_LEFT_ANCHOR, app.transformationMatrices.add({horizontalScaleFactor:pw/aw, verticalScaleFactor:pw/aw}));
        img.parent.fit(FitOptions.FRAME_TO_CONTENT);
        app.scriptPreferences.measurementUnit = AutoEnum.AUTO_VALUE;
        return img.parent
    } 
}

 


 

 

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines