Thumbnail
Thumbnail copied to clipboard
Width and height should be positive integer
Hello, I am trying to generate a thumbnail with this code
$path = $request->media->store($mediaPath);
// generate thumbnail
$videoPath = storage_path('app/public/').$path;
$thumbnailPath = storage_path('app/public/');
$thumbnailImage = now()->timestamp.".jpg";
$time_to_image = 1;
$t_status = Thumbnail::getThumbnail($videoPath, $thumbnailPath, $thumbnailImage, $time_to_image);
if($t_status) {
$media->path = $path;
$media->thumbnail_path = $thumbnailPath.$thumbnailImage;
$media->type = 'video';
} else {
return response()->json(['error' => true]);
}
However, I keep getting Width and height should be positive integer
.
I am using Laravel 7 and PHP 7.4
Hi @jjbofficial could you submit a reproducible example in a repository.
@lakshmaji could you please put a link with the instructions on how to do that, I haven't written code for an open-source project before
@jjbofficial you can paste a GitHub repository link here, which contains a POC which uses this library (no business logic / other functionality code isn't required) along with reproducible issue.
or you can use https://laravelplayground.com/ to create a reproducible demo with the mentioned issue