public function getConstrainedDimensions($curW, $curH, $maxW, $maxH)
	{
	    $this->debug->groupCollapsed(__METHOD__);
	    $ratio = $curW / $curH;   // > 1 = wider than tall (landscape) < 1 = portrait
	    $return = array('w' => $curW, 'h' => $curH);
	    if ($return['w'] > $maxW) {
	        $this->debug->log('fitting to maxW');
	        $return = array(
	            'w' => $maxW,
	            'h' => round($maxW / $ratio)
	        );
	    }
	    if ($return['h'] > $maxH) {
	        $this->debug->log('fitting to maxH');
	        $return = array(
	            'w' => round($maxH * $ratio),
	            'h' => $maxH
	        );
	    }
	    // $this->debug->log('return', $return);
	    $this->debug->groupEnd();
	    return $return;
	}