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

Deprecated #18

Open
ivose opened this issue Feb 23, 2023 · 3 comments
Open

Deprecated #18

ivose opened this issue Feb 23, 2023 · 3 comments

Comments

@ivose
Copy link

ivose commented Feb 23, 2023

Deprecated: Implicit conversion from float 146.574... to int loses precision in C:\xampp\htdocs\myproj\PHP_ICO.php on line 193 ($color |= 0xFF000000 & ( $alpha << 24 );). I've php version: PHP Version 8.2.0 . Possible solution: line 190 ought to be $alpha = intval((1 - ($alpha / 127)) * 255);.

@jschwind
Copy link

9552d28

@gavriel-adi
Copy link

gavriel-adi commented Nov 17, 2023

On the class-php-ico.php page replace line 187 to 193 including:

				$color = imagecolorat( $im, $x, $y );
				$alpha = ( $color & 0x7F000000 ) >> 24;
				$alpha = ( 1 - ( $alpha / 127 ) ) * 255;
				$color &= 0xFFFFFF;
				$alpha_shifted = intval($alpha) << 24;
				$color |= 0xFF000000 & $alpha_shifted;

It works great for me, I was happy to help

@gtraxx
Copy link

gtraxx commented Nov 17, 2023

I made adaptations for PHP 8 and added fixes.

#20

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

4 participants