Jump to content

imagecolorsforindex(): Argument #2 ($color) is out of range


adrian
 Share

Recommended Posts

Hi @horst - not sure if this is your code or Ryan's, but thought I'd ask you first. I am seeing that error when calling resize on a GIF.

It is pointing to line: 866 in /wire/core/ImageSizerEngineGD.php

The second argument is returning 255.

Perhaps the solution here: https://stackoverflow.com/questions/3874533/what-could-cause-a-color-index-out-of-range-error-for-imagecolorsforindex is what is needed.

Any thoughts?

Thanks,
Adrian

Link to comment
Share on other sites

Hi @adrian,

this is very old legacy code from before 2013 when I joined PW, - and it is from a community member named "mrx": https://github.com/processwire/processwire/blob/master/wire/core/ImageSizerEngineGD.php#L863

So, the referenced SO post seems to be the solution already. Maybe you can send me an image that has this error, so that I can test it. Or would you like to write and test the fix yourself? (As you already have done all necessary work.) ?

 

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...