q2a / question2answer

Question2Answer is a free and open source platform for Q&A sites, running on PHP/MySQL.
http://www.question2answer.org/
GNU General Public License v3.0
1.63k stars 628 forks source link

Avatar can only be loaded with 50px and cannot be changed #895

Closed rklec closed 1 year ago

rklec commented 3 years ago

After I upgraded to v1.8.6 I have the problem that avatars can only be loaded with a size of 50 pixel and no one can upload a new avatar.

52px are e.g. used in the top right as an avatar image and 50 px are used in questions.

http://.../?qa=image&qa_blobid=150...&qa_size=50 # works

http://.../?qa=image&qa_blobid=150...&qa_size=52 # does not work

Also the failing requests (i.e. both requests) return a 200 HTTP Code, however. IMHO, this should not happen.


When I try to upload an avatar as a PNG image, I get this error:

Das Bild konnte nicht gelesen werden. Bitte laden Sie eines hoch von: GIF, JPG, PNG

In English:

The image could not be read. Please upload one of: GIF, JPG, PNG

I.e. it wrongly claims the file format is wrong.

Q2A v1.8.6 PHP 8.0.1

QROkes commented 3 years ago

Yes, I can confirm this issue. In my case, size=200 is correctly loaded and 50 and 20 are failing. I'm also using PHP 8.

pupi1985 commented 3 years ago

@QROkes @rklec Can you check the pull request I've just linked and test that branch? Bare in mind you should clear the browser's cache before testing. Thanks.

QROkes commented 3 years ago

Thanks a lot @pupi1985 it works like a charm!

rklec commented 3 years ago

The PR is https://github.com/q2a/question2answer/pull/906 - BTW you can link it at the right side or by using a keyword in the PR/commit body (not title).

pupi1985 commented 3 years ago

The PR is linked as the log shows. No need to explicitly mention it again. Also, I can't link it in the "right side" because I'm not a collaborator but rather a contributor. Finally, it is part of the commit body, which is why, by default, gets added to the title. I see no reason to modify the title, anyway.

Aside from that, @rklec, is it working for you or not? :)

rklec commented 3 years ago

It was just a helpful tip for the text time, it is only linke dhere, because the commit is linked, the PR was not linked. I did not test the PR yet.