Photo problem

Hello everyone. Can someone kindly please brainstorm the following with me please?

I am trying to upload user photos. I ran into this issue where when I upload a profile photo, it turns black when one view the user’s profile. I tried many diffirerent photos, different sizes, dpi’s, pixels, nothing seems to fix this problem. Except… for this one photo (a random photo from the internet) that uploads just fine. The odd thing is, when I for example edit this photo (in paint) the edit version does not get uploaded either… the website keeps showing the original unedited version.

I tried giving other photos the same name as this one photo that is working ,with the hope that I can replace it on the cpanel file folder… but even when I replace this photo, it still shows up as the profile photo. When I delete this photo, and try a complete diffirent photo again, this new photo goes goes black again…

I tried playing around with permissions (everything from 777 to you name it). I tried to clear the cache. I tried different browsers. Does anyone have any advice what else I can try please?

Thanks inadvance…

Hi Mel, very interesting! I wonder if this is an issue with the way the editor on your computer us working? If you right click on one of the black images, and select Open Image in New Tab (or similar, depending on your browser), what do you see? Can you send both one of the pre-upload images, and the URL of an uploaded image to us on support@gibbonedu.org so that we can investigate? Thanks!

Another option could be a missing gd graphics library in PHP, if the user admin page is trying to resize the images and failing. Be sure to check the System Check in System Admin for any missing libraries.

Hi Sandra, apologies, I did not see this reply.

The photo thing is very strange… I was hoping that after updating to the new Gibbon version, that this would go away, but it is still doing the same thing. It gets weirder, when I use Badges, I have no problem assigning random photos downloaded from the internet to those badges. It is just profile photos that seems to refusse to cooperate.

To answer y our first question, I opened the photo in a seperate tab - and it remains black. I will email the sample photos to you guys just now…

For your second suggestion - I checked the Gibbon systems tab - it is moaning about the uploads folder not being secure (I guess made it publicly visislbe during my whole update drama), and it moants about max_input_vars >= 5000 which is currently at 1000. I passed all the requirements previously, so not sure if it is related to photos.

Let me email you the photos… I keep my fingers crossed that you hopefully have a solution.

Thanks so much again for all your help and support.

Hi mel,

Thanks for testing these suggestions out. The difference between user photos and photos elsewhere in Gibbon is that the user photos will try to crop and resize on save using the GD image library. I suspect this may be the source of the issue. Which version of PHP do you have? Sometimes this library needs installed for a specific version, and the installation changed a bit with PHP 8.0.

One way to test could be to edit the modules/User Admin/user_manage_editProcess.php and remove lines 282-338 that deal with image resizing (make a copy of the file first so it’s easy to restore later).

Ross pointed me towards the email you sent with example photos, which I had missed. I’ll check these out and get back to you. Thanks!

Hi mel,

It looks like this was indeed a bug with the image resizing code only supporting jpg images and not png images. I’ve fixed the issue for v25, which you can see in the following commit and apply the same changes to your codebase: https://github.com/GibbonEdu/core/commit/a2c39a33977aad8c3bcd75450ad8e23c67e8df4a

Thanks for catching this and sharing detailed information to help us fix it.

Hi Sandra, thank you so much for taking the time to look into this matter for me. I really appreciate it. May I ask, is there a rough ETA for when v25 might be available? (Or could I add the line you added to v25 to my current v24 installation maybe? Not sure if such a thing is possible in Gibbon…).

Thank you again for all your help…
Mel

Hi Sandra, thank you so much for taking the time to look into this matter for me. I really appreciate it. May I ask, is there a rough ETA for when v25 might be available? (Or can I add the line you added to v25 to my current v24 installation maybe?).

Thank you again for all your help…
Mel

(Apologies, the last message appeared as an unsend draft for some reason - but it seems it actually did send before…but now there are two of the same messages :smiley: It is not my day today.)

Hi Mel, no worries, we all have those days! As per our Gibbon Road Map, v25 will be released on January 20th 2023, but the changes should be backward compatible to v24, and so yes, copy those lines into your installation and let us know how you get on. Cheers! Ross