Ao executar o exemplo de redimensionamento de imagens está dando esse erro.
<?php
require_once 'vendor/autoload.php';
use Alura\Threads\Student\InMemoryStudentRepository;
$repository = new InMemoryStudentRepository();
$studentsList = $repository->all();
foreach ($studentsList as $student) {
echo 'Resizing ' . $student->fullName() . ' profile picture' . PHP_EOL;
$path = $student->profilePicturePath();
$pathWin = str_replace('/', '\\', $path);
resizeTo200PixelsWidth($pathWin);
echo 'Finish resizing ' . $student->fullName() . ' profile picture' . PHP_EOL;
}
function resizeTo200PixelsWidth($imagePath)
{
[$width, $height] = getimagesize($imagePath);
$ratio = $height / $width;
$newWidth = 200;
$newHeight = 200 * $ratio;
$sourceImage = imagecreatefromjpeg($imagePath);
$destinationImage = imagecreatetruecolor($newWidth, $newHeight);
imagecopyresampled($destinationImage, $sourceImage, 0, 0, 0, 0, $newWidth, $newHeight, $width, $height);
imagejpeg($destinationImage, __DIR__ . '/storage/resized/' . basename($imagePath));
}