Support Forum
It seems that my users cannot upload avatars since I moved the site to a new server (at Liquidweb).
They always get an error saying that something went wrong with resizing the image.
The problem is solved by deactivating "Auto resize avatar uploads" in the Forum option.
However, I'd like to have these uploads resized automatically as there will certainly be members who don't care (or don't know) about avatar size.
It worked well on the previous server.
What could be the reason why the resize option is not working anymore?
Does the resize function require anything specific (except simple press) being installed on the server?
The permission setting of the avatar folder (where the images are stored) is 777 (rwxrwxrwx), so that should not be the problem.
Marc
you should not have a directory with 0777 - that is risky and could cause server issues...
any errors in the log? what exactly is the error message...
You say you updated SP, but what version of WP? The avatar resizing uses functions built into WP... they are not our own...
Visit Cruise Talk Central and Mr Papa's World
What setting (instead of 0777) should I use for that folder?
The error I get in the forum when the "resize" option is activated is this:
There are few errors in the error log that might be related to this:
The software versions I have installed are:
SP 5.2.6
WP 3.5.2
So, is the "GD graphics library" a possible reason for the problem?
Best and preferred folder permission setting is 755. Some hosts will not actually serve data if the folder is 777.
Doesn't seem a GD library issue so that's OK.
Looks like those errors in your log point to the issue but I am unsure yet what that might be. Will need to do a little code research and possibly wait for Steve (Mr Papa) to arrive on the scene. Seems to be something to do with the avatar file name...
We'll come back on this asap.
YELLOW
SWORDFISH
|
you should still check with your host... wp still needs the GD or ImageMagik library to do its thing..
its a wp function and you would have to do more internal checking to see what the error is...
to get more info, you would need to make a slight code mod and dump the wp error to the screen so we can see what they are complaining about... up to that?
Visit Cruise Talk Central and Mr Papa's World
find file simple-press/forum/profile/ahah/sp-ahah-profile-save.php... down around line 348, find this section of code:
$sfavatars = sp_get_option('sfavatars'); if ($sfavatars['sfavatarresize']) { $editor = wp_get_image_editor($uploadfile); if (is_wp_error($editor)) { @unlink($uploadfile); $message['type'] = 'error'; $message['text'] = sp_text('Sorry, there was a problem resizing the avatar'); return $message; } else { $editor->resize($sfavatars['sfavatarsize'], $sfavatars['sfavatarsize'], true); $imageinfo = $editor->save($uploadfile); $filename = $imageinfo['file']; } }
after the line
if (is_wp_error($editor)) {
add this:
ashow($editor);
when you save upload an avatar and it gets resized, this should dump the wp error object to the screen and give more info as to why wp failed to resize it...
Visit Cruise Talk Central and Mr Papa's World
Hmm... doesn't seem to work.
After editing the code and activating "avatar resizing" in the forum options, now nothing happens when I click the "upload avatar" button. Also the (green) error message 'Sorry, there was a problem resizing the avatar' does not appear.
Is it possible that ashow($editor); throws an exception?
Any alternative?