-
sampleImage() and “unsafe operation attempted”
I keep getting an “unsafe operation attempted” error when using sampleImage() function, any idea on how to fix this ?
Here’s the code I picked from one of the posts here and adapted a little:sampleSize = [thisComp.width/2,thisComp.height/2];
target = thisComp.layer(“CLIP”);
samplePos = [target.width,target.height]/2;
rgb = target.sampleImage(samplePos, sampleSize, true, valueAtTime(2));
hsl = rgbToHsl(rgb);
hsl[2]*100P.A.T.