function parseParamString($str) { // $str contains "qlow-200px" or "200px" strings because thumb.php would strip the filename // first - check if the string begins with "qlow-", and if so, treat it as quality. // Pass the first portion, or the whole string if "qlow-" not found, to the parent // The parsing must match the makeParamString() above $res = false; $m = false; if (preg_match('/q([^-]+)-(.*)$/', $str, $m)) { $v = $m[1]; if (self::validateQuality($v)) { $res = parent::parseParamString($m[2]); if ($res) { $res['quality'] = $v; } } } else { $res = parent::parseParamString($str); } return $res; }