Login Image Errors when trying to set new Login Image

Hey Guys,

I'm getting the following errors (see below) when trying to upload a new login image.

Setup is as follows:
WP 3.0.5 - Multisite / Subdirectories
Login Image 1.0.7
Nginx

I am guessing it is a server setup thing but I have no idea where to start. Permissions appear to be fine.

Warning: chmod() [function.chmod]: No such file or directory in /home/traus/sites.thomsonreuters.com.au/public_html/wp-content/plugins/login-image/login-image.php on line 214

Warning: unlink(/XXXX/public_html/wp-content/login-image/login-form-image.png) [function.unlink]: No such file or directory in /XXXX/public_html/wp-content/plugins/login-image/login-image.php on line 215

Warning: imagecreatetruecolor() [function.imagecreatetruecolor]: Invalid image dimensions in /XXXX/public_html/wp-includes/media.php on line 999

Warning: imagecopyresampled(): supplied argument is not a valid Image resource in /XXXX/public_html/wp-content/plugins/login-image/login-image.php on line 144

Warning: imagepng(): supplied argument is not a valid Image resource in /XXXX/public_html/wp-content/plugins/login-image/login-image.php on line 151

Warning: Cannot modify header information - headers already sent by (output started at /XXXX/public_html/wp-content/plugins/login-image/login-image.php:214) in /XXXX/public_html/wp-includes/pluggable.php on line 890

I have a similar issue with the avatar plugin when I try to use the "Alternative Upload" Method - but it's not an issue because the normal upload method works fine.

Thanks in advance.

  • DavidM
    • DEV MAN’s Mascot

    Hello Jason,

    I really wish I could be of more help on this one but I'll have to see if I can find help from others with Nginx history. What I've done at least as a start is tagged this thread with an "nginx" tag and I'm using that to go through other "nginx" tagged threads to try and find something relevant.

    That said, I'll still check around for anyone with some Nginx background.

    Cheers,
    David

  • Jason
    • Flash Drive

    Ok so I think I have got to the bottom of it - I don't believe it is my setup..appears to be a combination of the following which were causing me errors:

    - The plugin doesn't appear to check for the existence of files before it attempts to remove them
    - The plugin doesn't like it if I upload an image with the correct dimensions (310 x 70) - for some reason it sets blank dimension values instead of 0 or the originals
    - The plugin doesn't like it if I upload an image file called "login-form-image.png" (which happens to be what it wants to rename all images uploaded through it to).

    I've since added in a few "if file_exists" statements before any line where the plugin tries to remove a file and added the following:

    if ($dst_x == null) {$dst_x = 0;}
    if ($dst_y == null) {$dst_y = 0;}
    if ($src_x == null) {$src_x = 0;}
    if ($src_y == null) {$src_y = 0;}
    if ($dst_w == null) {$dst_w = 310;}
    if ($dst_h == null) {$dst_h = 70;}
    if ($src_w == null) {$src_w = $orig_w;}
    if ($src_h == null) {$src_h = $orig_h;}

    prior to

    $im_dest = wp_imagecreatetruecolor( $dst_w, $dst_h );
    imagecopyresampled( $im_dest, $im, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h );

    To fix the image dimensions error messages.

    I'm not going to worry about the file name issue for the time being.

    The above works for me - so might work for others.

    I know it's not the most elegant solution but it will do in the interim.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.