Copy link to clipboard
Copied
I have a template in which I want to place several images. All these images have a different pixel-size and I want them all to be resized to 1080 pixels wide.
When I make an action using the Transform tool it records that action with a percentage. For example, when I place an image which is 2160 pixels wide and I record the action so that the image is transformed to 1080 pixels wide, the action records that the transformation is done by 50%.
But when I place a second image (say 3000 pixels wide) and I run the action, the image gets transformed to 1500 pixels wide (50%), but that's not what I want, I want that second image to be 1080 pixels wide.
So how can I make the action record a transformation to 1080 pixels wide in stead of resizing it to 50% ?
Thanks in advance for your help.
A scripted solution:
#target photoshop
(function (){
var startRulerUnits = app.preferences.rulerUnits;
app.preferences.rulerUnits = Units.PIXELS;
var bounds = activeDocument.activeLayer.bounds;
var width = bounds[2].value - bounds[0].value;
var newSize = (100 / width) * 300; // 300px
activeDocument.activeLayer.resize(newSize, newSize, AnchorPosition.MIDDLECENTER);
app.preferences.rulerUnits = startRulerUnits;
})();
https://prepression.blogspot.com/2017/11/downloading-and-installing-adobe-scripts.html
...Copy link to clipboard
Copied
Try this action, it offers 2 different methods and you can turn off the dialog to use a fixed non-interactive size:
Copy link to clipboard
Copied
A scripted solution:
#target photoshop
(function (){
var startRulerUnits = app.preferences.rulerUnits;
app.preferences.rulerUnits = Units.PIXELS;
var bounds = activeDocument.activeLayer.bounds;
var width = bounds[2].value - bounds[0].value;
var newSize = (100 / width) * 300; // 300px
activeDocument.activeLayer.resize(newSize, newSize, AnchorPosition.MIDDLECENTER);
app.preferences.rulerUnits = startRulerUnits;
})();
https://prepression.blogspot.com/2017/11/downloading-and-installing-adobe-scripts.html
Originally from:
https://graphicdesign.stackexchange.com/questions/58812/specific-resize-layer-action
Copy link to clipboard
Copied
Copy link to clipboard
Copied