Handle image file and save it to media
What I did was to get media folder and save there the cropped image. After that update meta data: $imageToCropPath= get_attached_file($attachmentId); // Get file path to the image that will be cropped $img = imageCreateFromJpeg($imageToCropPath); $croppedImage = imagecrop($img, [‘x’ => $cropX, ‘y’ => $cropY, ‘width’ => $cropWidth, ‘height’ => $cropHeight]); $uniqueId = md5(uniqid()); // Create … Read more