Because you're missing an argument in your ternary operator, it should be this syntax:
$height = $height ? $height : $width;
$quality = $quality ? $quality : $this->quality;
$filename = $filename ? $filename : $this->filename;
There should be 2 variables following the ? symbol, separated by a : symbol. The first variable is what is set if the condition (before the ?) is true. The second variable is what is set if the condition is false.
EDIT:
The syntax ?:
is only available since PHP version 5.3, make sure you're running php 5.3 or greater.