nette / utils

🛠 Lightweight utilities for string & array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.
https://doc.nette.org/utils
Other
1.98k stars 147 forks source link

Image: Return sizes must be integer only. #214

Closed janbarasek closed 4 years ago

janbarasek commented 4 years ago

I think return sizes from calculateCutout must be int only.

In case of float Image throw TypeError:

Snímek obrazovky 2020-02-17 v 14 51 34

Thansk.

dg commented 4 years ago

I think you're hiding a usercode mistake. crop() accepts only int|string.

janbarasek commented 4 years ago

@dg Ok, I understand.

I think float should be converted to int. What do you think about?

Because float is very common type, for example by round($width / 2) in user code.

dg commented 4 years ago

But it creates inconsistency. PHP does not convert float to int in strict mode.