Thumbnail icon indicating copy to clipboard operation
Thumbnail copied to clipboard

Width and height should be positive integer

Open jjbofficial opened this issue 3 years ago • 3 comments

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

jjbofficial avatar Jun 26 '21 17:06 jjbofficial

Hi @jjbofficial could you submit a reproducible example in a repository.

lakshmaji avatar Jul 02 '21 13:07 lakshmaji

@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 avatar Jul 08 '21 22:07 jjbofficial

@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

lakshmaji avatar Jul 14 '21 13:07 lakshmaji