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

Add initial test suite, fix a few bugs in the process #12

Closed
wants to merge 7 commits into from

Conversation

Jalle19
Copy link
Contributor

@Jalle19 Jalle19 commented Oct 3, 2019

Closes #11

This is a bit WIP still, but assuming you have Docker installed you can run the tests with:

composer install --ignore-platform-reqs
docker build -t phpunit-vips .
docker run -v $(pwd):/app --rm phpunit-vips php ./vendor/bin/phpunit

Currently it outputs this:

PHPUnit 7.5.16 by Sebastian Bergmann and contributors.

Runtime:       PHP 7.1.32
Configuration: /app/phpunit.xml.dist

......................III...................I...........          56 / 56 (100%)

Time: 283 ms, Memory: 6.00 MB

There were 4 incomplete tests:

1) Intervention\Image\Vips\Tests\VipsSystemTest::testFitImageSquare
PNG resizing produces wrong colors due to alpha blending into the pixels

/app/tests/VipsSystemTest.php:325

2) Intervention\Image\Vips\Tests\VipsSystemTest::testFitImageRectangle
PNG resizing produces wrong colors due to alpha blending into the pixels

/app/tests/VipsSystemTest.php:341

3) Intervention\Image\Vips\Tests\VipsSystemTest::testFitImageWithConstraintUpsize
PNG resizing produces wrong colors due to alpha blending into the pixels

/app/tests/VipsSystemTest.php:358

4) Intervention\Image\Vips\Tests\VipsSystemTest::testGammaImage
Pixel color values are slightly off

/app/tests/VipsSystemTest.php:807

OK, but incomplete, skipped, or risky tests!
Tests: 56, Assertions: 452, Incomplete: 4.

Sam Stenvall added 7 commits October 3, 2019 16:10
Tests for non-implemented features have been removed, some asserted values have been changed whenever it has made sense (i.e. not a bug), some tests with dubious behavior are marked as incomplete.
These only have one channel + alpha
When brightening an image, color values from getpoint() can be over 255
@Jalle19
Copy link
Contributor Author

Jalle19 commented Oct 3, 2019

I couldn't get the pixel values to be correct in some of the tests, it seems to be an issue with VIPS itself (possibly in combination with indexed PNGs). The Docker image has libvips 8.8.0 while some stuff regarding this was maybe fixed in 8.8.3, could be that it's fine with a newer library version.

@bonzai
Copy link
Member

bonzai commented Oct 3, 2019

Thanks! I will check it in the coming days.

@Jalle19 Jalle19 closed this Oct 22, 2024
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.

Adding initial CI support and unit tests
2 participants