I’m thinking along the lines of:
Make Background a Layer. Increase Canvas Size to 200% both dimensions. Select Transparency Channel (double-click on the Layer thumbnail). Transform Selection>Rotate 90 degrees. Align to Left and Top (say) and Crop. Then Select Transparency Channel again, Crop.
That would give you a square of the Top for Portrait images and the Left for Landscape images I think.
Brian, You could copy this into a jsx-file, put it into Presets Scripts and give it a try:
// crop to a square of the documents shorter sides length;
// use it at your own risk;
#target photoshop
if (app.documents.length > 0) {
var myDocument = app.activeDocument;
var originalRulerUnits = preferences.rulerUnits;
preferences.rulerUnits = Units.PIXELS;
var theShorter = getTheShorter(Number(myDocument.width), Number(myDocument.height));
var dlg = new Window ("dialog", "select new length for shorter side in pixels", [300,300,600,380]);
dlg.theNewLengthField = dlg.add(‘edittext’, [12,12,285,35], theShorter, {multiline:false});
dlg.theNewLengthField.active = true;
dlg.buildBtn = dlg.add(‘button’, [12,45,140,55], ‘OK’, {name:’ok’});
dlg.cancelBtn = dlg.add(‘button’, [160,45,285,45], ‘Cancel’, {name:’cancel’});
var myReturn = dlg.show ();
if (myReturn == true) {
var theNewLength = Number(dlg.theNewLengthField.text);
if (myDocument.width >= myDocument.height) {
myDocument.resizeImage (null, theNewLength, null, ResampleMethod.BICUBIC);
// the anchor-positions are easily changed to TOPLEFT, BOTTOMRIGHT etc.;
myDocument.resizeCanvas (theNewLength, theNewLength, AnchorPosition.MIDDLECENTER)
}
else {
myDocument.resizeImage (theNewLength, null, null, ResampleMethod.BICUBIC);
myDocument.resizeCanvas (theNewLength, theNewLength, AnchorPosition.MIDDLECENTER)
}
};
preferences.rulerUnits = originalRulerUnits;
}
else {
alert ("no document open")
};
function getTheShorter(a,b) {
if (a <= b) {
var x = a}
else {
var x = b};
return x;
};