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

Scale Expression With Set Width

New Here ,
Aug 15, 2018 Aug 15, 2018

Copy link to clipboard

Copied

Hi all,

I've been searching for a while now for the best way to achieve this, but can't seem to find what i'm looking for.

It's basically this: I'm creating a template for our editors that will act as a shell or housing for any video/image that they put in. The shell then automatically resizes to fit around the image that the editors choose. The image/video file to be used in the template could be a variety of sizes and aspect ratios. They could be 16x9 video clips, a portrait oriented image, an old 4x3 video clip, anything really. Regardless of the size and ratio of the layer, no matter what, I want the resulting width in the scale property to be exactly 920 pixels, even if that means I will be scaling something up and losing resolution, for this project, that is ok.

This is where I run into an issue. I need the image/video to maintain its aspect ratio, but have a width of 920 pixels. I have found a few different ways to input a specific pixel size through an expression, but I only want to input the width, and have the expression give me the resulting height, if it were to maintain its original aspect ratio since the user could put in anything that they want.

Is there a way to do this without having to input the target size for the [1] position?

Thanks!

TOPICS
Expressions

Views

2.2K

Translate

Translate

Report

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

correct answers 1 Correct answer

Community Expert , Aug 15, 2018 Aug 15, 2018

Like this maybe:

value*(920/width)

Dan

Votes

Translate

Translate
Community Expert ,
Aug 15, 2018 Aug 15, 2018

Copy link to clipboard

Copied

Like this maybe:

value*(920/width)

Dan

Votes

Translate

Translate

Report

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
New Here ,
Aug 16, 2018 Aug 16, 2018

Copy link to clipboard

Copied

Yep, that was exactly what I was needing. I think I was trying to over complicate this more than it needed to be. Thanks so much for the help Dan!

Votes

Translate

Translate

Report

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 Beginner ,
Nov 17, 2021 Nov 17, 2021

Copy link to clipboard

Copied

LATEST

Thank You

Votes

Translate

Translate

Report

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