Crop image with fixed ratio

I have been searching now for two days and finally found the video on YouTube (Part 3-4 - Directory Opus 12.10 Tutorial-Highlights, around 02:40) with your instructions on a button using which one can crop an image with a fixed ratio (4:3 in my case)

I copied the following code from the screen:

@toggle:if Show VIEWERCMD=se1aspect,4:3
@if:Show VIEWERCMD=se1aspect,4:3
Show VIEWERCMD=se1aspect, reset
@if:else
show VIEWERCMD=se1aspect,4:3

When I insert that code in the button, nothing happens.

What am I doing wrong?
Thanks!

it only works in image viewer toolbar.

Thanks, but that's where I tried it... in image viewer toolbar.

The command doesn't select or crop anything. It makes it so that when you make a selection it is restricted to the specified aspect ratio.

You can select in the image viewer by dragging with the mouse. Depending on configuration, you may need to hold shift at the same time. (Or you may need to change the viewer's button configuration if it isn't set to select via either method.)

Thank you.

I watched your video, Leo, and I believe, I am doing exactly what you demonstrate.

  1. I select a picture by double-clicking. A 'Preview-Window' (???) pops up.
  2. Then I hold down the 'SHIFT-KEY' and select an area which of course is arbitrary since there are no restrictions yet.
  3. In the 'Preview-Window' I create a button (CUSTOMIZE->NEW->NEW BUTTON), give it a name and insert your code (copied from the video).
  4. Now this button is in the 'Preview Window' and clicking on it achieves absolutely nothing.

When I reread the post pointing me to a 'Viewer Pane' I realized there was a second way to view the picture. But I couldn't create a button in the 'Viewer Pane'. So I placed a new button right next to the 'Help?'-button with your code. I can turn on the 'Viewer Pane' now, access my '4x3'-button. Alas, nothing happens.

I am not a coder, just a little bit skilled with simple functions. Cropping a picture 4x3 is something I do several times a day,roughly 4x3 so far.

Please show me where I'm going wrong...

I'm assuming you tried step 2 again after clicking the button in step 4.

After clicking that button, does it change appearance to indicate it's "on"?

Could you post a screenshot of the window that the button is in?

The code in the top post of this thread will only work with the standalone viewer.

I think slightly different code would work with the viewer pane, but let's solve the standalone viewer problem first.

No, there's no change at all. And your right, I tried of course selecting and pressing the button time and again, no change.

Two screenshots:

(Removed by request.)

one more

(Removed by request.)

Thanks for your time :smiley:

Found the problem. It's hard to notice, due to the font, but your command has the number "1" instead of the letter "l" in all the "selaspect" (selection aspect).

(There's also an extra space that might make it not turn off.)

Here's the correct code:

@toggle:if Show VIEWERCMD=selaspect,4:3
@if:Show VIEWERCMD=selaspect,4:3
Show VIEWERCMD=selaspect,reset
@if:else
Show VIEWERCMD=selaspect,4:3

Thank you very much. There's a lot of beer waiting for you here :slight_smile:
Indeed, I used 'Text Extract' from the Microsoft Powertoys. Not gonna do that again...
Super videos by the way :smiley:

ps. Could someone please remove the screenshots now (copyright). Thank you!

2 Likes

See also: Button - Crop Image Fixed Ratio