We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2566e80 commit 42852b3Copy full SHA for 42852b3
src/Transformers/ImageResizer.php
@@ -92,8 +92,8 @@ public function resize(array &$sample) : void
92
{
93
foreach ($sample as &$value) {
94
if (DataType::detect($value)->isImage()) {
95
- $width = imagesx($value);
96
- $height = imagesy($value);
+ $width = imagesx($value) ?: 0;
+ $height = imagesy($value) ?: 0;
97
98
if ($width === $this->width and $height === $this->height) {
99
continue;
src/Transformers/ImageVectorizer.php
@@ -91,8 +91,8 @@ public function fit(Dataset $dataset) : void
91
$value = $sample[$column];
$this->sizes[$column] = [
- imagesx($value),
- imagesy($value),
+ imagesx($value) ?: 0,
+ imagesy($value) ?: 0,
];
}
0 commit comments