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

Prevent implicit conversion from float to int in FileSizeOptimizedWidthCalculator #3145

Merged
merged 1 commit into from
Jan 5, 2023

Conversation

QuentinGab
Copy link
Contributor

Hi,

Super simple PR to prevent implicit conversion from float to int and so, prevent a warning to be log.
Example of a warning:

Implicit conversion from float 7616.5962599999975 to int loses precision in ...\vendor\spatie\laravel-medialibrary\src\ResponsiveImages\WidthCalculator\FileSizeOptimizedWidthCalculator.php on line 46

@freekmurze freekmurze merged commit aae852a into spatie:main Jan 5, 2023
@freekmurze
Copy link
Member

Thanks!

@boryn
Copy link
Contributor

boryn commented Sep 30, 2023

Good, it's finally solved, but IMHO solution presented here #3030 would be better - that is accepting float at finishedCalculating() instead of (int) casting the $predictedFileSize

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

Successfully merging this pull request may close these issues.

3 participants