Skip to main content
Inspiring
January 29, 2023
Question

Upper limit to number of files processed in one session

  • January 29, 2023
  • 2 replies
  • 1816 views

Does anyone know if there is a limit to the number of file you can process at any time?

Obviously milage may vary 🙂

 

I had a simple script that worked. Tried it as a batch process on a folder of 13,918 images and it just fell over. So I re-wrote the script to process a folder 1000 images at a time. 

On the fifth or so iteration it fell over and photoshop crashed.

Worked fine after re-starting Photoshop

In the end I managed to process all the images but it was a bit hit and miss.

 

So, is there a sort of maximum limit set in Photoshop image process wise?

 

This topic has been closed for replies.

2 replies

D Fosse
Community Expert
Community Expert
January 29, 2023

This sounds to me like you're running out of disk space.

 

With multiple files open at the same time, the size of the scratch file will grow rapidly. It contains all history states for all open documents. That may be orders of magnitude more than any RAM you may have installed, and you could easily need 1 TB or more, depending.

 

If one file is closed before the next one opens, the scratch file will be kept at a more normal size.

PECourtejoie
Community Expert
Community Expert
January 29, 2023

Can purging steps be added to the script?

D Fosse
Community Expert
Community Expert
January 29, 2023

..or set History States to 1?

Legend
January 29, 2023

No, there is no limit.

I process up to 25 thousand images with one script without problems. Run the script in the code editor and see what error it crashes with - this will help you solve the problem. If you use recursive functions, then the script may crash due to a call stack overflow - I have encountered such an effect, so I always try to first save the list of files into a separate array, and then sequentially process it avoiding recursions. It is also possible that the script crashes due to lack of disk space.

If you post your script, I can try it on my image set.

PECourtejoie
Community Expert
Community Expert
January 29, 2023

HEllo, In addition to a description or posting the script, listing the specs of the machine could be of help, you can do so easily by posting the contents of Photoshop's Help>System Info... menu, you can remove the section with the plugins, it makes the post very long.
If your post disappears, do not repost it, as it might need to be approved by a moderator. As an alternative you can save it to a .txt file on your computer and attach it on your answer via the forum. (attachments do not post from e-mail)