Making a photoshop image resize script8/10/2023 All is does is resize the canvas.Īpp.lerUnits = Units.PIXELS ĭesc11.putUnitDouble( idWdth, idPxl, lSide ) ĭesc11.putUnitDouble( idHght, idPxl, lSide ) ĭesc11.putEnumerated( idHrzn, idHrzL, idCntr ) ĭesc11.putEnumerated( idVrtc, idVrtL, idCntr ) ĮxecuteAction( idCnvS, desc11, DialogModes. Then you want the image to be a 1:1 aspect ratio, so that would mean increasing the canvas size, rather than resizing the image to the longest dimension. So according to your last post, it looks like you're trimming rather than "cropping." So you don't actually want to crop into the image. Var idpureAspectRatio = stringIDToTypeID( "pureAspectRatio" ) ĭesc6.putEnumerated( idcropAspectRatioModeKey, idcropAspectRatioModeClass, idpureAspectRatio ) ĮxecuteAction( idCrop, desc6, DialogModes.NO ) Var idcropAspectRatioModeClass = stringIDToTypeID( "cropAspectRatioModeClass" ) Var idcropAspectRatioModeKey = stringIDToTypeID( "cropAspectRatioModeKey" ) Var sSide = parseInt(Math.min(doc.width,doc.height)) ĭoc.resizeImage(lSide,lSide,undefined,ResampleMethod.BICUBIC) ĭesc7.putUnitDouble( idLeft, idPxl, x1 ) ĭesc7.putUnitDouble( idBtom, idPxl, y2 ) ĭesc7.putUnitDouble( idRght, idPxl, x2 ) ĭesc6.putUnitDouble( idAngl, idAng, 0.000000 ) Var lSide = parseInt(Math.max(doc.width,doc.height)) The Dialog will not display when the action is played the script records the settings you used recording the action into the Actions step when the action is played these setting are used the script bypasses displaying its dialog so the action can be batched. When recording the Action the scripts Dialog will look like this.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |