on line 70
from
$o=exif_read_data($image)['Orientation'];
to
$o=exif_read_data($image);
$o=$o['Orientation'];
on line 85
from:
if ($img->getImageGeometry()['height']> $tH) {$img->scaleImage(0,$tH);}
to:
$imgheight = $img->getImageGeometry();
if ($imgheight['height'] > $tH) {$img->scaleImage(0,$tH);}