You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An array of colors can be empty when there are no colors in the image.
In the function max and min, you can not pass an empty array, otherwise the function will return false and throw warning.
Stacktrace:
Warning: max(): Array must contain at least one element
Exception trace:
() at vendor/marijnvdwerf/material-palette/src/ColorCutQuantizer.php:101
marijnvdwerf\palette\Vbox->getVolume() at vendor/marijnvdwerf/material-palette/src/ColorCutQuantizer.php:39
marijnvdwerf\palette\ColorCutQuantizer->quantize() at vendor/marijnvdwerf/material-palette/src/PaletteGenerator.php:47
marijnvdwerf\palette\PaletteGenerator->generate() at vendor/marijnvdwerf/material-palette/src/Palette.php:59
I've taken a look at this and I can only replicate the error when using the problem image. If I try to recreate the image the recreated image works fine. I note as well that I couldn't load the problem image in MacOS's Preview application so I'm thinking it might be the image at fault.
That said, the findSplitPoint() method in the ColorCutQuantizer class returns 0 for this image at some point during the processing:
An array of colors can be empty when there are no colors in the image.
In the function max and min, you can not pass an empty array, otherwise the function will return false and throw warning.
Stacktrace:
Warning: max(): Array must contain at least one element
Sample code
Problem image
The text was updated successfully, but these errors were encountered: