Skip to content

Image::place() converts percentage arguments to numeric value - #122

Merged
dg merged 1 commit into
nette:masterfrom
PavelJurasek:patch-1
Oct 24, 2016
Merged

Image::place() converts percentage arguments to numeric value#122
dg merged 1 commit into
nette:masterfrom
PavelJurasek:patch-1

Conversation

@PavelJurasek

Copy link
Copy Markdown
Contributor

Fixes compatibility with PHP 7.1 as it caused E_NOTICE: A non well formed numeric value encountered in Image.php:474.

@dg

dg commented Oct 19, 2016

Copy link
Copy Markdown
Member

@PavelJurasek

Copy link
Copy Markdown
Contributor Author

Done

@PavelJurasek

Copy link
Copy Markdown
Contributor Author

Is anything else needed?

@dg

dg commented Oct 22, 2016

Copy link
Copy Markdown
Member

abs() is missing

@PavelJurasek

Copy link
Copy Markdown
Contributor Author

Fixed

@dg

dg commented Oct 24, 2016

Copy link
Copy Markdown
Member

Thanks

@dg
dg merged commit 53e7466 into nette:master Oct 24, 2016
Comment thread src/Utils/Image.php Outdated
{
if (is_string($newWidth) && substr($newWidth, -1) === '%') {
$newWidth = (int) round($srcWidth / 100 * abs($newWidth));
$newWidth = (int) round($srcWidth / 100 * substr($newWidth, 0, -1));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that abs() should stay here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

8683a0b was merged. abs is present in that commit.

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