Error with alternative upload in Blog Avatar Plugin

Hi,

I get the following errors when I click on alternative upload on the Blog Avatar page in Dashboard. Is there a remedy for this or should I remove error reporting in php?

Thanks,

AK

Error Below

============

There was an error uploading the file, please try again.

Warning: imagecopyresampled(): supplied argument is not a valid Image resource in /path/to/mu/install/public_html/wp-content/mu-plugins/avatars.php on line 448

Warning: imagecopyresampled(): supplied argument is not a valid Image resource in /path/to/mu/install/public_html/wp-content/mu-plugins/avatars.php on line 456

Warning: imagecopyresampled(): supplied argument is not a valid Image resource in /path/to/mu/install/public_html/wp-content/mu-plugins/avatars.php on line 464

Warning: imagecopyresampled(): supplied argument is not a valid Image resource in /path/to/mu/install/public_html/wp-content/mu-plugins/avatars.php on line 472

Warning: imagecopyresampled(): supplied argument is not a valid Image resource in /path/to/mu/install/public_html/wp-content/mu-plugins/avatars.php on line 480

Warning: unlink(/path/to/mu/install/public_html/wp-content/avatars/blog/c81/) [function.unlink]: Is a directory in /path/to/mu/install/public_html/wp-content/mu-plugins/avatars.php on line 1212

  • afzz
    • WPMU DEV Initiate

    Hi,

    doc: I have php 5.2.6

    I noticed that these errors occur if there was no file selected via the browse button. A code to check this before executing can be added to the plugin. Users may not select a file with browse like I did in the following situation:

    1. User Browses and selects a file and clicks on upload.

    2. User has problem cropping the uploaded image

    3. Now the user may click on the Alternative Upload after reading the message about cropping problems displayed on the plugin page. This results in errors.

    Therefore a code to check if there is no file selected for upload can be added to the plugin.

    On Another note, Transparent PNGs when cropped get a black background. Is there a way to maintain transparency or at least add a functionality to select a background color before cropping?

    Thanks,

    AK

  • Andrew
    • Champion of Loops

    I’ll look into tossing back a nicer error when a file isn’t selected.

    On Another note, Transparent PNGs when cropped get a black background. Is there a way to maintain transparency or at least add a functionality to select a background color before cropping?

    I kept running into issues when trying to keep the transparency for PNGs and GIFs. So for now the transparency just isn’t kept.

    Thanks,

    Andrew

  • drmike
    • DEV MAN’s Mascot

    Heh, now I’m getting this issue on James’ box with the alt uploader. :slight_smile:

    edit: Hmmm, php 5.2.6 as well.

    reedit: Scratch that. It’s an education issue. I’m clicking on the “Alt Upload” button thinking that it’ll take me to a new uploader page. If I assign a image file to use and then click on the “Alt Upload” button, I don;t get the error.

  • drmike
    • DEV MAN’s Mascot

    Um, I do have a question though about the included options-discussion.php file. The icon used on the mystery line is not the local mystery icon but a hardcoded one for gravatar:

    http://www.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s=32