We have to process around 56000 files in which we have to mix two multip layers files (.psd) preserving the layers, remove a few predefined layers and them merge all layers and save the final file to .jpg.
Our code is working perfectly. But after processing around 6k files we get this error message: Invalid layer index: XX (XX = layer number)
If we break the files in groups of around 1k to 2k each then everything works just great. But this is not always practically possible for us to break all the files in small groups.
Firstly, does it still happen with 10.2.0? A layer indexing issue was fixed not too long ago.
The error occurs when a call is made to ImageEnView1.Layers[] with an index value that is >= ImageEnView1.LayersCount. It might be in your code or could be in ours. It could be a timing or a resource issue. Are you able to narrow down the steps leading up to the error? Can you create a demo that reproduces it?