Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Width and height should be positive integer #32

Open
jjbofficial opened this issue Jun 26, 2021 · 3 comments
Open

Width and height should be positive integer #32

jjbofficial opened this issue Jun 26, 2021 · 3 comments

Comments

@jjbofficial
Copy link

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

@lakshmaji
Copy link
Owner

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

@jjbofficial
Copy link
Author

@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

@lakshmaji
Copy link
Owner

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants