I can't get screencapture to work work when triggered with exec() command.
$output = exec("/usr/sbin/screencapture -R 0,0,450,150 hehe.png"." 2>&1"); echo $output; // in /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
I am not sure what the
$output message is trying to convey.
disable_functions is empty.
I have a feeling that this is a osx problem. Can you point me in the right direction regarding solving this problem?
from man screencapture
SECURITY CONSIDERATIONS To capture screen content while logged in via ssh, you must launch screencapture in the same mach bootstrap hierarchy as loginwindow: PID=pid of loginwindow sudo launchctl bsexec $PID screencapture
I'm not using any ssh. PID of which process should be used in this case?
exec("sudo launchctl bsexec $PID screencapture -R 0,0,450,150 hehe.png");