Fix it again
This commit is contained in:
parent
a0580ad085
commit
519611d06b
@ -48,6 +48,7 @@ class Resizer
|
||||
private function createVariant(Image $original, ResizeParams $params): string
|
||||
{
|
||||
$quality = $params->quality ?: -1;
|
||||
$this->logger->info("Resizing image", ['params'=>$params]);
|
||||
|
||||
$original->toWidth($params->width ?? intval($_ENV["DEFAULT_WIDTH"]));
|
||||
|
||||
|
@ -36,10 +36,15 @@ class SqliteImageDb implements ImageDb {
|
||||
$query .= $params->quality ? ' AND quality = :quality' : ' AND quality IS NULL';
|
||||
|
||||
$stmt = $this->db->prepare($query);
|
||||
$stmt->bindParam(':path', $path);
|
||||
if ($params->width !== null) $stmt->bindParam(':width', $params->width);
|
||||
if ($params->height !== null) $stmt->bindParam(':height', $params->height);
|
||||
if ($params->quality !== null) $stmt->bindParam(':quality', $params->quality);
|
||||
|
||||
$queryParams = [
|
||||
':path' => $path,
|
||||
];
|
||||
if ($params->width !== null) $queryParams[':width'] = $params->width;
|
||||
if ($params->height !== null) $queryParams[':height'] = $params->height;
|
||||
if ($params->quality !== null) $queryParams[':quality'] = $params->quality;
|
||||
|
||||
$stmt->execute($queryParams);
|
||||
|
||||
$this->logger->info("Querying images", ['query' => $stmt->queryString]);
|
||||
|
||||
|
@ -12,7 +12,7 @@ class ResizeParams
|
||||
|
||||
public function __construct(array $params)
|
||||
{
|
||||
$this->width = intval($params['width']) ?: intval($_ENV["DEFAULT_WIDTH"]);
|
||||
$this->width = isset($params['width']) ? intval($params['width']) : intval($_ENV["DEFAULT_WIDTH"]);
|
||||
$this->height = intval($params['height']) ?: null;
|
||||
$this->quality = isset($params['quality']) ? intval($params['quality']) : null;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user