|
Author |
Message |
derekc
Joined: 17 Jul 2010
Posts: 3
|
Posted: Sat Jul 17, 2010 3:20 am Post subject: Automatic rotation of portrait photos |
|
|
I take a large number of images at a time, often for other people and always in Raw (Canon EOS 5D). Is there a way of Photoshop (CS3) detecting portrait mode images from the EXIF info, and rotating them 90 CW automatically, in a Batch command. I would then save them as jpegs in the Batch and pass to someone else. _________________ Derek Clements |
|
|
|
|
Paul R
Joined: 06 Apr 2010
Posts: 57
|
Posted: Sat Jul 17, 2010 5:23 am Post subject: |
|
|
You might be better doing all this from Bridge, you could use the following code to select the portrait pics, then ctrl/r to open them all in ACR and from there you can save them to JPG the orientation should be automatic.
Save the code as filename.jsx (plain text file)
Start Bridge
Edit - Preferences -Startup Scripts
At the bottom click the "Reveal Button" this will open the folder where the script should be placed.
Close and restart Bridge.
To use:
Mouse Right click (menu) and select "Select Portraits"
Code: |
#target bridge
if( BridgeTalk.appName == "bridge" ) {
selectPortraitPics = new MenuElement("command", "Select Portraits", "at the end of Thumbnail");
}
selectPortraitPics.onSelect = function () {
selectPortrait();
}
function selectPortrait() {
app.document.deselectAll();
var sels = app.document.visibleThumbnails;
for (var a in sels){
if(sels[a].type != "file") continue;
var testThumb = new Thumbnail(sels[a]);
app.synchronousMode = true;
var orientation = testThumb.core.quickMetadata.rotation;
if(orientation == 8) app.document.select(sels[a]);
}
}
|
|
|
|
|
|
derekc
Joined: 17 Jul 2010
Posts: 3
|
Posted: Sat Jul 17, 2010 9:59 am Post subject: |
|
|
Thanks for your reply.
I've set this up but can't get it to work. The 'select portraits' appears in the menu.
Do I do the right click (menu) on the folder containing the raws in Bridge, or do I select all files within the folder? Neither appears to work.
Derek _________________ Derek Clements |
|
|
|
|
Paul R
Joined: 06 Apr 2010
Posts: 57
|
Posted: Sat Jul 17, 2010 10:39 am Post subject: |
|
|
I missed the other 180deg rotation, sorry.
You should be able to navigate to the required folder then run the script, all it will do is select all the portrait pics.
This is now modified to select all types of portrait pics.
Code: |
#target bridge
if( BridgeTalk.appName == "bridge" ) {
selectPortraitPics = new MenuElement("command", "Select Portraits", "at the end of Thumbnail");
}
selectPortraitPics.onSelect = function () {
selectPortrait();
}
function selectPortrait() {
app.document.deselectAll();
var sels = app.document.visibleThumbnails;
for (var a in sels){
if(sels[a].type != "file") continue;
var testThumb = new Thumbnail(sels[a]);
app.synchronousMode = true;
var orientation = testThumb.core.quickMetadata.rotation;
var Height = testThumb.core.quickMetadata.height;
var Width = testThumb.core.quickMetadata.width;
if(Height > Width) app.document.select(sels[a]);
if(orientation == 8 || orientation == 6) app.document.select(sels[a]);
}
}
|
|
|
|
|
|
derekc
Joined: 17 Jul 2010
Posts: 3
|
Posted: Sat Jul 17, 2010 11:37 am Post subject: |
|
|
Thanks. I've installed the new script.
It still doesn't appear to work. Should the folder be open in Bridge, ie showing the files, or one level up showing the folder?
The other explanation is that the raw files don't contain the information that's needed for the script to work, but I'm not sure how to check.
Thanks for your patience.
Derek _________________ Derek Clements |
|
|
|
|
Paul R
Joined: 06 Apr 2010
Posts: 57
|
Posted: Sat Jul 17, 2010 11:43 am Post subject: |
|
|
Yes you need to navigate to the folder where the files are to be selected.
If it still doesn't work it may be down to how you have saved the script.
Some editors will enter control characters into the script and stop it working. The best this is to use ExtendScript ToolKit, this is installed with Photoshop.
I have tested the script in CS3/4 and 5 so I do know it works. |
|
|
|
|
|