spatie / laravel-medialibrary

Associate files with Eloquent models
https://spatie.be/docs/laravel-medialibrary
MIT License
5.78k stars 1.08k forks source link

Fix DivisionByZeroError in File::getHumanReadable() #3549

Closed ziming closed 9 months ago

ziming commented 9 months ago

After updating to the latest media library I got this Divide by Zero error

Think this commit broke it https://github.com/spatie/laravel-medialibrary/commit/81876c36c09d717e99e7c07cad8dd2775e25504e

freekmurze commented 9 months ago

Could you add a test for this, so we don't get regressions in the future?

ziming commented 9 months ago

@freekmurze added!

freekmurze commented 9 months ago

Thanks!