Skip to content

Make imagebmp_basic.phpt more resilient #17265

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

Merged
merged 1 commit into from
Dec 25, 2024

Conversation

cmb69
Copy link
Member

@cmb69 cmb69 commented Dec 25, 2024

Checking for the exact output of most image formats is brittle; even an otherwise change to some header field causes the output to change, even if the image would be visually identical.

Checking for an (MD5) hash is even worse, since if the tests fails, we have no clue for what reason.

Thus we compare the generated image against an pre-generated PNG, using a test helper which will output a simple image diff in case of test failure.

Checking for the exact output of most image formats is brittle; even an
otherwise change to some header field causes the output to change, even
if the image would be visually identical.

Checking for an (MD5) hash is even worse, since if the tests fails, we
have no clue for what reason.

Thus we compare the generated image against an pre-generated PNG, using
a test helper which will output a simple image diff in case of test
failure.
Copy link
Member

@devnexen devnexen left a comment

Choose a reason for hiding this comment

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

Thanks !

@cmb69 cmb69 merged commit c1c6520 into php:master Dec 25, 2024
10 checks passed
@cmb69 cmb69 deleted the cmb/imagebmp_basic.phpt branch December 25, 2024 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants