This topic is locked

Orientation of image from IPAD to windows

2/18/2016 12:22:26 AM
PHPRunner General questions
lefty author

I have the following code in phprunner 8.0 before add without using encoding/decoding ( which makes this process more complicated ) So I just have an image file set to 1 file upload. I am trying to change the orientation of the file from ipad to windows but to no avail . This code below is as far as I got but no deal. I think it has something to do with the function not being recognized by phprunner ex. parameters $image and $ort. Any ideas here. This is straight from the PHP manual . EXIF DATA ORIENTATION
$filename = "../photos_bonus/".$values["fldphoto"].".jpg";

if (file_exists($filename))

{

$exif = exif_read_data($filename, 0, true);

$ort = $exif['IFD0']['Orientation'];

switch($ort)

{

case 1: // nothing

break;
case 2: // horizontal flip

$image->flipImage($public,1);

break;
case 3: // 180 rotate left

$image->rotateImage($public,180);

break;
case 4: // vertical flip

$image->flipImage($public,2);

break;
case 5: // vertical flip + 90 rotate right

$image->flipImage($public, 2);

$image->rotateImage($public, -90);

break;
case 6: // 90 rotate right

$image->rotateImage($public, -90);

break;
case 7: // horizontal flip + 90 rotate right

$image->flipImage($public,1);

$image->rotateImage($public, -90);

break;
case 8: // 90 rotate left

$image->rotateImage($public, 90);

break;

}
}

return true;