Photoshop create histogram getting document information in automation plugins
Using big files (more than 5Gb) to get document information to know number of layers or selected layes in a automation, Photoshop spend a lot of time creatiing histograms.
Execution this short code on a big file, Photoshop starts create histograms.
SPErr error = kSPNoError;
PIActionDescriptor result = NULL;
PIActionReference reference = NULL;
Boolean hasKey;
error = sPSActionReference->Make(&reference);
if (error) goto returnError;
error = sPSActionReference->PutEnumerated(reference, classDocument, typeOrdinal, enumTarget);
if (error) goto returnError;
sPSActionControl->Get(&result, reference);
if (result != NULL)
{
//....
}
returnError:
if (result != NULL) sPSActionDescriptor->Free(result);
if (reference != NULL) sPSActionReference->Free(reference);
return (error);
I'm trying to set 'keyUseCacheForHistograms' in some places with same result.
There is any way to get document information dissabling create histograms in Photoshop?