Skip to content

Commit 42852b3

Browse files
committed
Appease Stan
1 parent 2566e80 commit 42852b3

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Transformers/ImageResizer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ public function resize(array &$sample) : void
9292
{
9393
foreach ($sample as &$value) {
9494
if (DataType::detect($value)->isImage()) {
95-
$width = imagesx($value);
96-
$height = imagesy($value);
95+
$width = imagesx($value) ?: 0;
96+
$height = imagesy($value) ?: 0;
9797

9898
if ($width === $this->width and $height === $this->height) {
9999
continue;

src/Transformers/ImageVectorizer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ public function fit(Dataset $dataset) : void
9191
$value = $sample[$column];
9292

9393
$this->sizes[$column] = [
94-
imagesx($value),
95-
imagesy($value),
94+
imagesx($value) ?: 0,
95+
imagesy($value) ?: 0,
9696
];
9797
}
9898
}

0 commit comments

Comments
 (0)