Skip to content

Commit

Permalink
Transform widths & heights can be null
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonkelly authored and angrybrad committed May 6, 2019
1 parent b7f88cc commit 6c95ef6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ private function _migrateTransforms()

foreach ($transformRows as &$row) {
unset($row['uid']);
$row['width'] = (int)$row['width'];
$row['height'] = (int)$row['height'];
$row['width'] = (int)$row['width'] ?: null;
$row['height'] = (int)$row['height'] ?: null;
$row['quality'] = (int)$row['quality'] ?: null;
}

Expand Down
4 changes: 2 additions & 2 deletions src/services/AssetTransforms.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,13 +208,13 @@ public function saveTransform(AssetTransform $transform, bool $runValidation = t
$configData = [
'format' => $transform->format,
'handle' => $transform->handle,
'height' => (int)$transform->height,
'height' => (int)$transform->height ?: null,
'interlace' => $transform->interlace,
'mode' => $transform->mode,
'name' => $transform->name,
'position' => $transform->position,
'quality' => (int)$transform->quality ?: null,
'width' => (int)$transform->width
'width' => (int)$transform->width ?: null,
];

$configPath = self::CONFIG_TRANSFORM_KEY . '.' . $transform->uid;
Expand Down
4 changes: 2 additions & 2 deletions src/services/ProjectConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -2087,8 +2087,8 @@ private function _getTransformData(): array

foreach ($transformRows as &$row) {
unset($row['uid']);
$row['width'] = (int)$row['width'];
$row['height'] = (int)$row['height'];
$row['width'] = (int)$row['width'] ?: null;
$row['height'] = (int)$row['height'] ?: null;
$row['quality'] = (int)$row['quality'] ?: null;
}

Expand Down

0 comments on commit 6c95ef6

Please sign in to comment.