I am using Guillotine to let the user transform images. No instructions or examples are provided for how to actually apply the transformations on the server side. Using Intervention, how do you do this properly?
The image is sent to the server with the following instructions:
{ scale: 1.4, angle: 270, x: 10, y: 20, w: 900, h: 675 }
So how to we take that info and apply it to the photo?
Here is what I have so far:
// Gets the true initial orientation
$img->orientate();
// Mirrors the image to what the user sees
$img->flip('v')->flip('h');
if(isset($fileData['angle']) && $fileData['angle'] > 0 && $fileData['angle'] < 360){
$img->rotate($fileData['angle']);
}