Script that rotates a PNG in Photoshop?
-
28-10-2019 - |
Question
I have the following Photoshop ExtendScript (.jsx) script which rotates the image canvas, but doesn't rotate the contents:
var doc = app.open(...); // open the .png file
if (doc.width > doc.height) { // check if this document is landscape
doc.rotateCanvas(90); // rotate the canvas to portrait
// but how to rotate the contents?
}
I would like to rotate the entire image, contents included. I've tried also rotating all the document's layers, and art layers, but nothing works.
Solution
So... uh... yeah. If you want to rotate a PNG in Photoshop, the above script would be the way to do it. Code not shown here might cause it do something different, preventing the rotate from succeeding :).
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow