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

Seeder doesn't like $filepath #6

Open
monstermaker opened this issue Jun 23, 2020 · 0 comments
Open

Seeder doesn't like $filepath #6

monstermaker opened this issue Jun 23, 2020 · 0 comments

Comments

@monstermaker
Copy link

I have created this in Laravel 7.4 and it mostly works, but when trying to seed the database with users it shows the following error:
getimagesize(): read of 8192 bytes failed with errno=21 Is a directory

If I die and dump $filepath just before the $getImageSize = getimagesize($filepath); I get the correct file path with the faker image shown at the end as a .jpg image:
"/home/vagrant/code/car_app/storage/app/public/user-images/2020/6/23/24541ee1986411e54cbcb0c8b80482a9.jpg"

Taking out the getimagesize() section and replacing with fixed data shows an error on the next call to $filepath which is '$img = Image::make($filepath)' and the error says 'Image source not readable'

I have tried replaced $filepath with the value of $filepath (storage_path('app' . DIRECTORY_SEPARATOR .
'public' . DIRECTORY_SEPARATOR .
config('project.user.images_folder') . DIRECTORY_SEPARATOR .
$date->year . DIRECTORY_SEPARATOR .
$date->month . DIRECTORY_SEPARATOR .
$date->day . DIRECTORY_SEPARATOR .
$main_image_name)) directly and then it shows the issue as being the $main_image_name part.

When I run the seeder it does create some images in the correct sub folder in storage and also creates the three sizes in the correct sub folders in public/uploads. Sometimes there is one image created and sometimes 2 or 3 but it gets no further than this.

Maybe this is a timeout 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

1 participant