I am looking to flock() an image.
Currently I am using the following
$img = ImageCreateFromPng($img_path);
flock($img,LOCK_EX);
It seems that the GD library’s file handle is not valid with flock. How can I access the image and flock the file?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The function
flockonly works on file handles (or stream wrappers if they support locking). So, if you want to lock an image when you read it, you’d need to open it twice: