I use some code:
$colors = array ();
$colors['test'] = imagecolorallocate($img, 0 ,1 ,2);
....
It works until I change picture to other
After that imagecolorallocate
and imagecolorallocatealpha
return false
$img
is correct image, i.e imagepng
print it correctly
How to make imagecolorallocate
work?