# imageResize - Proportional resize

**URL:** <https://forums.creativeclouddeveloper.com/t/imageresize-proportional-resize/2641>\
**Category:** Photoshop\
**Tags:** javascript\
**Created:** [March 11, 2021, 4:01pm UTC](https://forums.creativeclouddeveloper.com/t/imageresize-proportional-resize/2641 "2021-03-11T16:01:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Timothy\_Bennett](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/timothy_bennett/32/1251_2.png) [@Timothy\_Bennett](https://forums.creativeclouddeveloper.com/u/Timothy_Bennett)\
**Post date:** [March 11, 2021, 4:01pm UTC](https://forums.creativeclouddeveloper.com/t/imageresize-proportional-resize/2641/1 "2021-03-11T16:01:25Z")

</div>

Hiya,

I’m finally dipping my toe into UXP after lots of CEP experience and I’ve quickly come up against something that I’m hoping someone can shed some light on.

In ExtendScript I could pass null to a resizeImage method for one of the pixel dimensions and resize an image proportionally. I can’t seem to do the same in UXP, it seems that now both dimensions need to be explicitly stated in pixels.

Am I missing something?

---

<div class="post-metadata">

**Author:** ![simonhenke](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/simonhenke/32/957_2.png) [@simonhenke](https://forums.creativeclouddeveloper.com/u/simonhenke)\
**Post date:** [March 11, 2021, 10:21pm UTC](https://forums.creativeclouddeveloper.com/t/imageresize-proportional-resize/2641/2 "2021-03-11T22:21:15Z")

</div>

In BatchPlay, there seems to be a property called `constrainProportions` for the imageSize event:

```
photoshop.action.batchPlay(
[
   {
      "_obj": "imageSize",
      "width": {
         "_unit": "pixelsUnit",
         "_value": 600
      },
      "scaleStyles": true,
      "constrainProportions": true,
      "interfaceIconFrameDimmed": {
         "_enum": "interpolationType",
         "_value": "nearestNeighbor"
      },
   }
],{});
```

---

<div class="post-metadata">

**Author:** ![Timothy\_Bennett](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/timothy_bennett/32/1251_2.png) [@Timothy\_Bennett](https://forums.creativeclouddeveloper.com/u/Timothy_Bennett)\
**Post date:** [March 19, 2021, 8:00pm UTC](https://forums.creativeclouddeveloper.com/t/imageresize-proportional-resize/2641/3 "2021-03-19T20:00:20Z")

</div>

Simon,  
apologies for my tardy response. This is perfect, thank you.
