Skip to content

Palette::findMaxPopulation() returns null for no swatches#16

Open
yarri wants to merge 1 commit intomarijnvdwerf:mainfrom
yarri:master
Open

Palette::findMaxPopulation() returns null for no swatches#16
yarri wants to merge 1 commit intomarijnvdwerf:mainfrom
yarri:master

Conversation

@yarri
Copy link

@yarri yarri commented Apr 5, 2023

Hi,

this patch fixes fatal error in PHP 8.0

ValueError: max(): Argument #1 ($value) must contain at least one element in /www/doc/myapp/vendor/marijnvdwerf/material-palette/src/Palette.php:81

@marijnvdwerf
Copy link
Owner

Thanks for your PR! You inspired me to actually get some CI running for this project. Do you have a sample image that causes this bug?

@yarri
Copy link
Author

yarri commented Apr 24, 2023

@yarri
Copy link
Author

yarri commented Apr 24, 2023

My test case is:

$manager = new Intervention\Image\ImageManager(["driver" => "imagick"]);
$img = $manager->make("image.jpg");
$palette = marijnvdwerf\palette\Palette::generate($img);

@yarri
Copy link
Author

yarri commented Oct 16, 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.

2 participants