I’m using the FAPI to provide the user an upload field for an image. The field is:
$form['product_img'] = [ '#type' => 'managed_file', '#description' => 'Upload a PNG or JPG image of the product.', '#multiple' => FALSE, '#required' => TRUE, '#upload_location' => 'public://', '#upload_validators' => [ 'file_validate_is_img' => , 'file_validate_extensions' => ['png jpg jpeg'] ] ];
A lot of the users are uploading images taken with their mobile device, resulting in the image in landscape.
The solutions I’ve seen involve the default file upload widget, but I need something that will automatically rotate the image after the upload.