Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.

Uploading profile image bug: PHP Notice: Undefined index: channels in /qa-include/qa-util-image.php on line 72

+1 vote
5,376 views
asked Feb 21, 2012 in Q2A Core by q2apro
After uploading an image to the profile, the following error message appears:

PHP Notice:  Undefined index:  channels in /qa-include/qa-util-image.php on line 72

 

Line 72 is:
$needbytes+=$width*$height*$imagesize['bits']*$imagesize['channels']/8*2;
// memory to load original image
 

help?

1 Answer

+1 vote
answered Feb 22, 2012 by gidgreen
This appears to be a PHP bug - the documentation promises these elements will always be in the array, but in fact they can sometimes be absent. I'll look into fixing this for Q2A 1.5.1.
commented Mar 8, 2012 by gidgreen
If you want to make the email not editable, just change this in qa-page-account.php:

$inemail=qa_post_text('email');

... to ...

$inemail=$useraccount['email'];

You can then give the email field a type of 'static'.
commented Mar 8, 2012 by q2apro
very good. Tested it, now changing the avatars works without any error message.

Thank you a lot!


PS: The only thing left is the undefined index bug posted in the original question according to my error.log ;)
...