Color index out of range!

See all posts Reply

Color index out of range! new!
by Paraleste Radu, 15 years, 7 months ago
Hello.

When i install the class on server i get the following error:

Warning: imagecolorsforindex() [function.imagecolorsforindex]: Color index -2147483648 out of range in /home/confro/public_html/test/class.upload.php on line 4049

can someone know how to fix it ?

ty.Reply
Re: Color index out of range! new!
by colin, 15 years, 7 months ago
Which version of the class are you using? What are you actually doing? What are the logs produced by the class? What images are you processing exactly? What is your code and settings for the class?

I need more information to answer....Reply
Re: Color index out of range! new!
by Paraleste Radu, 15 years, 7 months ago
1. I use the lasted version of class.
2. I dont know where I find the logs to view complete error.
3. Code is:
error_reporting(E_ALL); 
include('class.upload.php');
if ($handle->uploaded) {
  $handle->image_resize            = true;
  $handle->image_ratio_y           = true;
  $handle->image_x                 = 400;
  $handle->file_new_name_body 	 = 'xxx';	
}
$handle->Process('/images/');
echo $handle->error;
$handle-> Clean();

4. Image is a sample foto from my documents pictures.(windows xp)

5. I think can be a hosting problem because in my computer run perfectly but when I upload the hosting server I receive the error.

ThanksReply
Re: Color index out of range! new!
by Paraleste Radu, 15 years, 7 months ago
ups...cod is:
error_reporting(E_ALL);
include('class.upload.php');
$handle = new Upload($_FILES['my_field']);
if ($handle->uploaded) {
  $handle->image_resize = true;
  $handle->image_ratio_y = true;
  $handle->image_x = 400;
  $handle->file_new_name_body = 'xxx';
}
$handle->Process('/images/');
echo $handle->error;
$handle-> Clean();

wrong copy..:DReply
Re: Color index out of range! new!
by colin, 15 years, 7 months ago
For the log, please do the following, after calling process():
echo $handle->log;
Reply
Re: Color index out of range! new!
by Paraleste Radu, 15 years, 7 months ago
Oke. The image when I try to upload is uploaded but php have warning.

Here is the log and the error: http://www.conf.ro/test/log.html

Test: http://www.conf.ro/test/

If is a hosting error and have ideea to resolve it please tell beacause I talk with hosting administration to resolve.

ThanksReply
Re: Color index out of range! new!
by colin, 15 years, 7 months ago
Thank you for the details. Could you please send me the image that makes an error? Or link to it?Reply
Re: Color index out of range! new!
by Paraleste Radu, 15 years, 7 months ago
All images when I want to resize...if I delete $handle->image_resize = true; is all OK :).

If I modify error_reporting(1); again is all oke but I dont want :).Reply
Re: Color index out of range! new!
by Paraleste Radu, 15 years, 6 months ago
So there is no one to help me ?Reply
Re: Color index out of range! new!
by colin, 15 years, 6 months ago
Yes. I asked earlier: Could you please send me the image that makes an error? Or link to it?Reply
Re: Color index out of range! new!
by Paraleste Radu, 15 years, 6 months ago
oke.

Image: http://www.conf.ro/test/Blue%20hills.jpg

Test script: http://www.conf.ro/test/Reply
Re: Color index out of range! new!
by colin, 15 years, 6 months ago
Thank you. I don't manage to reproduce the error. Maybe your version of GD or PHP is slightly different, I am not sure...

However, I have implemented a fix which maybe solves your problem. You can download the version 0.27RC3 here.


Could you please test it and let me know whether it works?Reply
Re: Color index out of range! new!
by Paraleste Radu, 15 years, 6 months ago
Thanks. It's oke.Reply
Re: Color index out of range! new!
by colin, 15 years, 6 months ago
You mean that 0.27RC3 fixed the problem, and you don't have any errors?Reply
Re: Color index out of range! new!
by Paraleste Radu, 15 years, 6 months ago
I dont tested all class but when I tested simple upload with text and resize is OK.Reply