Picture Processor

Upload photoshop scripts, download photoshop scripts, discussion and support of photoshop scripts

Moderator: PS-Moderators

Re: Picture Processor

Postby S_K » Mon Mar 07, 2011 8:42 am

Paul MR wrote:Could you please explain why you would need to run one action for landscape and another for portrait?


Hello Paul,

Thanks for the reply.

Well, the reason it would be a nice feature, is that I have two different actions (i.e. Action A-land, Action B-port), each is specifically made for a portrait, or a landscape image. The "third" (C-choose, then run) action that I do have now does the trick (I call up the script in that action, then run Adobe's batch processor), in that it calls up a script that is able to differentiate from the two orientations.

Code: Select all
app.displayDialogs = DialogModes.NO;
var strtRulerUnits = preferences.rulerUnits;
preferences.rulerUnits = Units.PIXELS;
var actionfolder = 'MY actions MIXTURE';
var portrait = 'PROOF VERT B&W + 720px + 1/2 album 720';
var landscape = 'PROOF HOR B&W + 720px + 1/2 album 720';

if (activeDocument.height > activeDocument.width)
  {
  app.doAction(portrait,actionfolder);
  // alert('small'); // or issue a message
  //activeDocument.close(SaveOptions.DONOTSAVECHANGES);
  }
else
  {
   app.doAction(landscape,actionfolder); // you could point at another action here
  //activeDocument.close(SaveOptions.DONOTSAVECHANGES);
  }
preferences.rulerUnits = strtRulerUnits;


The only problem with this is that it doesn't have the ability to keep the same file structure as your picture processor, which is a great feature. After I run my action, it only puts it all in one folder, which I then have to manually structure again.

I hope that makes sense. If you have any further questions, or points of clarification you need from me, please don't hesitate to ask.

Thanks,
S_K

P.S. Hmm. Maybe I didn't answer your question correctly, after rereading the question. I need one action for each orientation because in "MY actions MIXTURE" actions, each "play"s other orientation specific actions in my action folder. For example:

MY actions MIXTURE action:
- Horizontal copyright stamp > Play Horizontal-stamp > Play Horizontal header > Play Horizonal footer > Play Horizontal-border > Save

and, of course, the other action would be:

- Vertical copyright stamp > Play Vertical-stamp > Play Vertical header > Play Vertical footer > Play Vertical-border> Save

It's probably not the cleanest, or most efficient way of doing things, but it's the only way I know how to at the moment. Hope that helps. Thanks.
S_K
 
Posts: 6
Joined: Thu Mar 03, 2011 7:30 am

Re: Picture Processor

Postby Paul MR » Tue Mar 08, 2011 11:11 am

I think most of those could be done within one action, but just to be safe I have added the option to run Action 1 for Landscape and Action 2 for Portrait...
Attachments
Picture Processor.zip
Action for Landscape/Portrait added
(15.18 KiB) Downloaded 325 times
Paul MR
 
Posts: 1472
Joined: Wed Oct 18, 2006 2:44 pm
Location: Bradford,UK

Re: Picture Processor

Postby S_K » Wed Mar 09, 2011 3:05 am

Hello Paul,

Thank you!!! It works as it's supposed to nicely. Now I have to figure out how to simplify/recreate/rethink my actions in a better step-by-step manner. "MY Action Mixes" hit a snag (not due to you) because it has a number (6 of them) of "Save for Web" commands in them, directed to 6 different folders, hence your file structure feature won't work for my particular "Mixes" actions (it just stops after processing one image, though it does still create the folder structure). BUT, I can already see how handy that landscape & portrait feature will be for me that you added, so thank you again, very much. It will definitely quicken my total processing time by a huge factor. What a time saver! Thank you for taking the time to look at your coding, and editing that in for me/us/the internetz (internetz...hahaha).

On a different note, you have an option called "Preserve Sub Folder Structure". I don't understand it fully. I saw the hover note that explains "Only folders that contain files will be created". I proceeded to test it, checked and unchecked with these setup.

Main "test" folder has 3 folders
- "folder one" all have picture stored in folders:
> "a"
> "b"

- "nothing" folder has no pictures in its one folder...
> "inside is nothing"

- "something in nothing" folder has two folders, one has nothing, and one has images
> "nothing 2"
> "that something"

Well, the results for enabled, or not enabled were both the same, thus seeming to have no effect at all.

Result:
Main "test" folder THEN has 2 folders
- "folder one" all have picture stored in folders:
> "a"
> "b"

- "something in nothing" folder NOW has only one folders, of course the one that has the image.
> "that something"

I guess I was expecting one option to be able to create the empty folders too. I don't know if that is the correct understanding of that option though.

Take care,
S_K
S_K
 
Posts: 6
Joined: Thu Mar 03, 2011 7:30 am

Re: Picture Processor

Postby KennethK » Fri Mar 11, 2011 5:30 am

Seems like a very useful script.

I have a WebHelp folder with 700 .jpg files, all high resolution, dispersed throughout a myriad of sub-folders, co-mingled with .html and .js files. If I can optimize the .jpg files for the Web, I can cut down their file size by 2/3, as I need to the the file size of the package down past a certain threshold. I see your Picture Processor script is designed to do exactly the job I need it for (thank you for that-- I've been looking for something like this for a long time!)... but I'm hitting a problem:

The "Process Sub Folders" checkbox does not work. If you check it and try to run the script, it simply does nothing. Uncheck it, and the script runs fine. I tried this with several combinations of different Save Options on different folders (some with, and some without, sub-folders), but the one consistency I found was that when you check "Process Sub Folders", the script doesn't run. The Picture Processor dialog closes, but nothing happens. Photoshop just sits there. (I thought maybe it was processing something behind the scenes, perhaps with no indicator, so I waited a few minutes, but nothing happened.)

Any idea what this could be? I am always selecting "Use Folder" with "Save files to existing folder" checked.

Otherwise, the script works great.

Thanks!
KennethK
 
Posts: 5
Joined: Thu Mar 10, 2011 11:00 pm

Re: Picture Processor

Postby Paul MR » Fri Mar 11, 2011 9:56 am

Sorry it doesn't seem to work for you, I have just done a quick test with nested folders eleven deep and no problems.
The main things that are needed :-
Use folder ticked
Save files to existing folder ticked
Process Sub Folders ticked
File Type JPG
Select the top Level Folder
FileNane Options Document Name

I was testing with Windows 7 on a local disc and Photoshop CS5

If you are still having problems could you please tell me what OS, Photoshop version, and if using local disks or network folders.
Paul MR
 
Posts: 1472
Joined: Wed Oct 18, 2006 2:44 pm
Location: Bradford,UK

Re: Picture Processor

Postby KennethK » Fri Mar 11, 2011 1:12 pm

Paul MR,

I'm on Win 7 with CS5, local disk.

  • Use Folder is checked
  • Save Files to Existing Folder is checked
  • Process Sub Folders is checked
  • File Type is JPG
  • I selected the top-level folder
  • FileName Options is Document Name
  • Save for Web is checked (60, No Metadata, sRGB is checked)

Just does noting. Dialog closes, Photoshop just sits there. If I uncheck Process Sub Folders, it works starts opening files immediately.

Note sure if this is relevant, but my top-level folder is:

C:\Users\Firstname.Lastname\Documents\My Work\Projects\OHL_Help\OHL_webhelp4\Content\Resources\Images

There's a "dot" in the user folder, a space in one of the folder names, and underscores in other folders. Since the problem is folder-related, I figured maybe that has something to do with it.

Thanks for your help.
KennethK
 
Posts: 5
Joined: Thu Mar 10, 2011 11:00 pm

Re: Picture Processor

Postby Paul MR » Fri Mar 11, 2011 5:42 pm

Thanks for the folder information and yes there can be a problem but it isn't what you would expect.
I set up the same path to do some tests and found that it only found One folder if the firstname was the same or included as a User.
Example my User is Paul
c:/users/paul/etc/etc
If I create a path:-
c:/users/paulAnythingAtAll/etc/etc
The system splits the folder name into two folders and shows as ~/AnythingAtAll so of course no file are found.
If I used c:/users/saulAnythingAtAll/etc/etc all folders are found also if c:/users/saul.AnythingAtAll/etc/etc is used all files are found

It does look as the problem is with using the Users folder and how the system processes the names, so haven't a clue on how to overcome this problem, except have a folder tree that does not use the Users folder.

Any suggestions from anyone to overcome this problem would be welcome.
Paul MR
 
Posts: 1472
Joined: Wed Oct 18, 2006 2:44 pm
Location: Bradford,UK

Re: Picture Processor

Postby KennethK » Fri Mar 11, 2011 5:59 pm

Thanks, Paul.

I moved my project to C:\, just to test things out. The path I'm using now is:

C:\OHL\Content\Images

But the same thing happens. Picture Processor dialog closes, and nothing happens. Could it have something to do with the fact that the folder and sub-folders have non-image files in them? Do you think this same problem might be more general than just the Users folder?
KennethK
 
Posts: 5
Joined: Thu Mar 10, 2011 11:00 pm

Re: Picture Processor

Postby Paul MR » Fri Mar 11, 2011 6:42 pm

That is very strange, that should have worked.
Could you please try this version as I have put some alerts in the script.
It should tell you how many folders it has found also alert everytime it tries to get the files from the next folder.

It just might point to what is happening.

N.B. THis version is for test purposes only.
Attachments
Picture Processor With Alerts.zip
For testing ONLY
(15.26 KiB) Downloaded 236 times
Paul MR
 
Posts: 1472
Joined: Wed Oct 18, 2006 2:44 pm
Location: Bradford,UK

Re: Picture Processor

Postby KennethK » Fri Mar 11, 2011 6:51 pm

Thanks, I'll test it out.

I did find a workaround, though.

I unchecked "Save files to existing folder", checked "Process Sub Folders", and checked "Preserve Sub Folder Structure". Then I set my Source Folder to C:\OHL\Content\Resources\Images and my Output folder to simply: C:\

This basically had the effect of overwriting the files on the same path. Worked flawlessly.

I'll test out what you sent, though, to provide some troubleshooting.
KennethK
 
Posts: 5
Joined: Thu Mar 10, 2011 11:00 pm

Re: Picture Processor

Postby KennethK » Sat Mar 12, 2011 6:18 pm

Paul MR,

I tested using the "Picture Processor with Alerts" script. I checked "Save files to existing folder" and checked "Process Sub Folders". The Output / Top Level Folder box was greyed out. I ran Save For Web (50, No Metadata, sRGB). The first alert was:

Number of folders found: 49
Processing /c/OHL/Content/Resources/Images
Files found = 13

Which is correct. It ran through the first 13, then popped up an alert for the second folder, and so on. So it seemed to be working.

Interestingly, I went back and ran the regular "Picture Processor" script with the same settings, and it worked. Bizarre. But the one difference I noticed was that the greyed out "Output / Top Level Folder" input still had "C:\" in it (from when I had previously ran it with "Save files to existing folder" unchecked). The associated "Browse" button is disabled, but the text is still in the input (ignored, I assume). My guess is that maybe the script doesn't react well when "Output / Top Level Folder" is completely empty, even if it's not used.
KennethK
 
Posts: 5
Joined: Thu Mar 10, 2011 11:00 pm

Re: Picture Processor

Postby Paul MR » Sat Mar 12, 2011 8:36 pm

Thanks for doing the test, some things are just a mystery. The "Output / Top Level Folder" when not used is not referenced so shouldn't cause a problem, and any details in this field are just loaded from the preferences object on the script being loaded.

Looks as if it was just a gremlin.
Paul MR
 
Posts: 1472
Joined: Wed Oct 18, 2006 2:44 pm
Location: Bradford,UK

Re: Picture Processor

Postby mEtH » Fri Jun 03, 2011 8:09 pm

I just stumbled on this site and its awesome. I really prefer this processor over the built in image processor, great job!

Is there any way to set it so that when you are downsizing images if the image is actually smaller than what you need that is just stays its existing size? I find that I always have to put those images in to another folder to process afterwards. My wife keeps putting these low res facebook images into our picture folders and I tend to find them when I batch process, up sampling them beyond recognition.So for instance if I want the images to be 1200px wide and I have images below that in the folder, It will only resize the images greater that 1200px.

Thank you!
mEtH
 
Posts: 1
Joined: Fri Jun 03, 2011 6:41 pm

Re: Picture Processor

Postby Paul MR » Sat Jun 11, 2011 8:54 pm

Sorry I didn't reply earlier as have been away.
Here is the modified script with the alterations..
Attachments
Picture Processor.zip
Custom Fit Image and UI changes made.
(17.25 KiB) Downloaded 318 times
Paul MR
 
Posts: 1472
Joined: Wed Oct 18, 2006 2:44 pm
Location: Bradford,UK

Re: Picture Processor

Postby Martyn » Tue Jul 05, 2011 8:49 pm

Wow, what an absolutely brilliant tool, so glad I found it!

I've been battling with actions, batch processing and the image processor, trying to find a decent solution for generating thumbnails of images in subdirectories and preserving the folder structure and every option was flawed slightly; save for web not being able to handle subdirectories and the save as command making a 150*100 thumbnail at least 20KB, no matter what JPG quality level you used.

This is perfect. 5KB thumbnails now!

One quick question, though it's not a big issue at all, more of a query... is there a way when resizing to only enter the width of the image you want and have the height change according to the ratio?

Cheers and thanks again!
Martyn
 
Posts: 1
Joined: Tue Jul 05, 2011 6:53 pm
Location: Newcastle under Lyme, England

PreviousNext

Return to Photoshop Scripts

Who is online

Users browsing this forum: No registered users and 1 guest