Thanks for the post.
I would recommend you make use of the PHP function imagerotate() to rotate the image and then save back the rotated image as a new file.
The code would look like so:
//define image path $filename="image.jpg"; // Load the image $source = imagecreatefromjpeg($filename); // Rotate $rotate = imagerotate($source, $degrees, 0); //and save it on your server... file_put_contents("myNEWimage.jpg",$rotate);
For loading the newly created image, you can make use of the acf/load_field filter after storing the image object in a $variable.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We've just released ACF 5.12.3 with a security fix to prevent arbitrary file uploads to forms with ACF fields.— Advanced Custom Fields (@wp_acf) July 14, 2022
Now that we've released this update, we recommend updating your sites as soon as possible.
© 2022 Advanced Custom Fields.