How to resize an image to the dimensions of the inner image?

Hello

I am preparing a JS script.

I need to resize an image (InDesign) to the dimensions of an inner picture (actually image shown by the framework itself).

So:

(1) I need to control if the frame is more (larger) great that image inside.

(2) if (1) it is true, I need to get the dimensions of the inner image and apply it on the frame.

(3) at the end, I'll have the framework fits perfectly to the image.

Is this possible?

Thank you and best regards,

Francesco Jonus

(1) I need to control if the frame is more (larger) great that image inside.

How to set this?

It is obvious for the one on the left, but what the right one?

If you care just about area, then calculate the area and check:

fb = app.selection[0].geometricBounds;
framewidth = fb[3]-fb[1];
frameheight = fb[2]-fb[0];
framesize = framewidth * frameheight;
ib = app.selection[0].images[0].geometricBounds;
imagewidth = ib[3]-ib[1];
imageheght = ib[2]-ib[0];
imagesize = imagewidth * imageheight;
if (framesize < imagesize) {
   alert("Frame is smaller!");
}

Tags: InDesign

Similar Questions

  • How to resize pictures to fit the screen without losing the proportions?

    I am trying to create a PowerPoint presentation and it will essentially consist of pictures, text and background music.  I want pictures to fill the screen of my computer, so when I'm in 5 items, I go to the Image menu and then Image resize - size and changing the pixel dimensions here.  My monitor is set to 1280 x 1024 pixels and I'm trying to resize my photos at 1280 x 1024, so that they will fill all the screen when you view the PowerPoint presentation.  The problem is that when I go to resize photos, I must leave options maintain Proportions unchecked so that I can freely and manually enter the values I want for both the width and height according to my monitor dimensions.  When my photo is resized by using this method, the proportions will throw off and the picture looks a little funny.  But if I check, select the maintain Proportions, then I won't be able to enter a value for one of the dimensions given that items will automatically appear the other dimension for me.  In this way the proportions look good, but the photo does not completely fill the screen in the way that I want.

    Is there some kind of workaround for this kind of catch-22 type of problem?

    Thank you

    Lee

    Lee,

    DSLR camera digital SLR particular means: http://en.wikipedia.org/wiki/DSLR.

    Jürgen

  • How to resize an image using PIXELS to define the width and height?

    I need make my image a certain number of pixels wide and high.  When I resize image I can't change the area that shows the pixels of width and height, and when I drop down lists it does not give option pixels.  When I choose "points" and "Pica" they are obviously not other names for the pixels because the given number is not the number of pixels above.  I used to be able to do it EASILY in elements 2.0, my previous version of elements.  I am now using 8.0.

    In fact, I just realized that nothing that I in image resize will change the number of pixels at ALL in question.  Size and pixel per inch are locked permanently in relationship to each other.  I had to download a new version not long because my computer hard drive has failed, and I think they changed the things that work so not now, because I would have noticed it before now if it's that way when I downloaded originally from that.  I begin to fear that I'll have to kludge with the crop tool, even if the resizing of the image SHOULD be able to.

    Make sure resample is checked:

  • How to resize an image on the layer of the photo?

    I'm trying to resize an imported picture to fit my current forms. Is there a way to do this? I tried pinching the image on the screen, but nothing helped.

    You must resize the entire layer. Press the three dots on the right side of the layer in the layers panel. Then press the cross to the left of the menu. Then, you can pinch to resize the layer

  • How to resize an image and preserve the ratio?

    I don't want to adapt the image control, take control of the image.

    Maybe this thread is useful?

  • How to resize multiple images in photoshop?

    Hello

    I want to known on several images resize only once without additional efforts.

    Concerning

    H T logical

    Hi ravih,

    You can create an Action is Photoshop, where you can save the Assembly once and then apply this action on several images at the same time.

    Reference: create actions in Adobe Photoshop

    How to: tutorial Photoshop 'Actions' - YouTube

    Let us know if that helps.

    Kind regards

    ~ Mohit

  • How to resize an image without crushing them there?

    I'm trying to add pictures to the Cup model, so when I resize it get crushed how I solve this problem

    Thank you

    If you are visually scaling by dragging the corner, simply hold the SHIFT key to constrain.

    If you enter values, in case the tool superior bar o r image > image size dialog box, just click on the little lock beside the width and height text boxes.

    If you need more help capture your screen so that we can see what you're doing.

  • How to resize controls to get the width

    Hi guys,.

    I will try to find a way to not hard code the width/height of the controls, checked a way to use 'USE_ALL_WIDTH' of bb4, but the DockLayout method, but the solution in this thread will not work, because I can not find DockLayoutProperties:

    is there properties such as USE_ALL_WIDTH or USE_ALL_HEIGHT

    So, how do you guys do when you need a control to get all the width of the screen size?

    Hello

    Suppose you want to give the width of button do as below:

    Container {
            layout: DockLayout {
            }
            Button {
                id: submitButton
                text: "Submit"
                onClicked: {
                }
    
                horizontalAlignment: HorizontalAlignment.Fill
                verticalAlignment: VerticalAlignment.Fill
    
            }
        }
    

    Do not include horizontalAlignment: HorizontalAlignment.Fill inside layoutproperty.

    Thank you

  • How to resize multiple photos in the "painting".

    I spent the last 24 photo re-sizing hrs one at a time their opening in 'Paint '... This became very boring! It seems to me that in order to change the dates in the form a whold group but can't re-size other than one at a time, and I'm not eben to half way through...

    Any suggestions? Help, please!

    Hello Jessie_Doug1,

    I used Fast Stone Resizer before, and it works fine.  Take a look at this and let me know if it will be easier for you.

    Good luck!

  • How to resize layers palette when the background is not visible?

    The bottom of my layers palette is less than the visible part of my computer screen... DC I now work abroad on my laptop (and the layers palette poster to the top of the same size as it was when I finally used Illustrator on my big screen).  How do I re-size, so I can use the items at the bottom of the palette?

    cannot drag you high?

    in any case, go to window-> Workspace and choose one of the workspaces, then if you want, return to the workspace that you had before, all sizes of palette will be restored.

  • Duh... I forgot how to resize an object on the Persic. Grid

    I've done this before, but can anyone help? I placed a symbol on a perspective grid. The online guide says to used the perspective tool, but I forgot how evolve instead of moving the item. Thank you.

    Command Shift B

    View > hide/show the bounding box

    We shift the command B

  • In Windows Live Movie Maker, how to make a subtitle with the inner different font sizes?

    How to make a subtitle with different font sizes, as in the old Windows Movie Maker?

    I want to produce an effect video, like MTV clips that fade in and out for video (not before or after the video). It of about what I want to produce and could not because the new WLMM seems to have this deleted title feature.

    My song (large)
    Composer (small fonts)

    I want that this block of text fade in and out for my video. Is there a way to do this? Otherwise I would feel obliged to go back to the old WMM.

    FWIW... going back to an older version of Movie Maker
    Maybe the answer. You need to restart your
    because the Live Movie Maker WLMP project project files
    would be not compatible.

    No guarantee but the next for an installable download
    version of Vista Movie Maker 6 may be worth a try

    * Proceed at your own risk *.

    (FWIW... it's always a good idea to create a system)
    Restore point before installing software or updates)

    Windows Movie Maker Installer for Windows 7
    http://noeld.com/programs.asp?cat=video#wmminst

    Also, Movie Maker 2.6 will work on Windows 7:

    Windows Movie Maker 2.6
    http://www.Microsoft.com/download/en/details.aspx?displaylang=en&id=34
    (this is similar to the version of Win XP Movie Maker 2.1)

  • How? Resize photos in the Gallery Windows without email?

    Hi all
    I need to know how to resize a photo in the Gallery Windows 1-4 (2). I want to keep this version of Windows. I don't want to send this picture. Rather, I need to resize the photo, save to my computer for later posting in a forum, I belong.
    The only option I see for resizing is in email. Ideas?
    Tina

    Hi all
    I need to know how to resize a photo in the Gallery Windows 1-4 (2). I want to keep this version of Windows. I don't want to send this picture. Rather, I need to resize the photo, save to my computer for later posting in a forum, I belong.
    The only option I see for resizing is in email. Ideas?
    Tina

    ==================================
    Maybe this article will be useful:

    Resizing Photos in Windows Live Photo Gallery

    If this is not the solution you ae looking for...
    the following free resizer might be worth a try:

    VSO Image Resizer
    http://www.VSO-Software.fr/products/image_resizer/

    VSO Image Resizer: tutorial
    How to resize my images and photos?
    http://www.VSO-Software.fr/products/image_resizer/how-to-compress-photos/how-to-resize-images-Guide.php

    John Inzer - MS - MVP - digital media experience

  • How to resize a photo/image and save it?

    Hello, I know how to resize an image. But how do I save a new image/photos Jpeg with new properties of size?

    Use file > save as or file > save for web. One of these will create a new document as long as the name is different or in another folder.

  • How to resize a 3D object after beeing merge with others

    Hello

    I would like to know how to resize a 3D after the merger with another 3d object object.

    I know not how to do this before merging, but Photoshop can import 3d as 3DS for example objects and

    After the merger of some appears very low compare to others...

    After the merger, it seems that it is only possible to resize the object piece by piece.

    When I resize before the merger, it makes no difference after the merger...

    Thanks for helping me

    You can resize the objects after the combination by adjusting the individual meshes

    on 3d objects more.

    http://help.Adobe.com/en_US/Photoshop/CS/using/WS31576EB8-5348-4a1e-A4E7-7D122A56F41F.html

    http://help.Adobe.com/en_US/Photoshop/CS/using/WS73EB2D8A-AAE0-4928-9BB6-357D63B1C855.html

    MTSTUNER

Maybe you are looking for