Imagecolorallocate allocation failed

Source: Internet
Author: User
Imagecolorallocate allocation failed
$ ImageHand = imagecreatefromgif ("images/mb.gif"); $ color = imagecolorallocate ($ imageHand, 0, 0); var_dump ($ color );


However, my imagecolorallocate always fails to be allocated. as a result, all the fonts in the future will be white and cannot be clearly viewed. what can I do to clear them?


Reply to discussion (solution)

What is the error?

Paste your image

You can use imagecreatetruecolor to create an image. if your image is 8bit, this is not acceptable.

What is the error?

Paste your image
That is, an error is not reported. I will manually run the var_dump command to return a false value for this color variable each time.

You can use imagecreatetruecolor to create an image. if your image is 8bit, this is not acceptable.
How can I check the picture? 8bit?


You can use imagecreatetruecolor to create an image. if your image is 8bit, this is not acceptable.
How can I check the picture? 8bit?

The problem is that you cannot assign colors.

Do you want to paste the image?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.