WordPress.org

Ready to get started?Download WordPress

Forums

Regenerate Thumbnails
Processing script dies on server side error (Version 2.1.1) (5 posts)

  1. pete-sch
    Member
    Posted 3 years ago #

    The script dies in the ajax error handler.
    There is no variable named "response" in the error handler.

    error: function() {
      RegenThumbsUpdateStatus( id, false, response );

    response is not defined
    RegenThumbsUpdateStatus( id, false, response );

    In my case, the disk was full.

    <br />
    <b>Warning</b>:  imagegif() [<a href='function.imagegif'>function.imagegif</a>]: Unable to open '/home/wp/public_html/wp-content/uploads/2010/10/bang-580x220.gif' for writing: Disk quota exceeded in <b>/home/wp/public_html/wp-includes/media.php</b> on line <b>445</b><br />
    {"success":"&quot;Bang&quot; (ID 30685) was successfully resized in 0.367 seconds."}

    Tip 1: You should check all the image manipulation functions return values to be sure that all images are successfully processed.
    Tip 2: You should suppress warnings to avoid non-JSON output.

    Thanks,

    http://wordpress.org/extend/plugins/regenerate-thumbnails/

  2. pete-sch
    Member
    Posted 3 years ago #

    As I can see, you use the "wp_generate_attachment_metadata" function.

    I tweaked my server to get a disk quote error again. There are the contents of the variable $metadata after running
    $metadata = wp_generate_attachment_metadata( $image->ID, $fullsizepath ); in ajax_process_image().

    Resize failed:

    Array
    (
        [width] => 600
        [height] => 398
        [hwstring_small] => height='84' width='128'
        [file] => 2010/03/portrait.gif
        [image_meta] => Array
            (
                [aperture] => 0
                [credit] =>
                [camera] =>
                [caption] =>
                [created_timestamp] => 0
                [copyright] =>
                [focal_length] => 0
                [iso] => 0
                [shutter_speed] => 0
                [title] =>
            )
    
    )

    Resize succeeded:

    Array
    (
        [width] => 600
        [height] => 398
        [hwstring_small] => height='84' width='128'
        [file] => 2010/03/portrait.gif
        [sizes] => Array
            (
                [thumbnail] => Array
                    (
                        [file] => portrait-150x150.gif
                        [width] => 150
                        [height] => 150
                    )
    
                [medium] => Array
                    (
                        [file] => portrait-300x199.gif
                        [width] => 300
                        [height] => 199
                    )
    
                [post-thumbnail] => Array
                    (
                        [file] => portrait-267x180.gif
                        [width] => 267
                        [height] => 180
                    )
    
                [S] => Array
                    (
                        [file] => portrait-60x60.gif
                        [width] => 60
                        [height] => 60
                    )
    
                [M] => Array
                    (
                        [file] => portrait-180x180.gif
                        [width] => 180
                        [height] => 180
                    )
    
                [F] => Array
                    (
                        [file] => portrait-580x220.gif
                        [width] => 580
                        [height] => 220
                    )
    
            )
    
        [image_meta] => Array
            (
                [aperture] => 0
                [credit] =>
                [camera] =>
                [caption] =>
                [created_timestamp] => 0
                [copyright] =>
                [focal_length] => 0
                [iso] => 0
                [shutter_speed] => 0
                [title] =>
            )
    
    )
  3. Alex Mills (Viper007Bond)
    Moderator
    Plugin Author

    Posted 3 years ago #

    Thanks. That's certainly helpful. I'll tweak my AJAX handler a bit. :)

  4. Alex Mills (Viper007Bond)
    Moderator
    Plugin Author

    Posted 3 years ago #

    Odd, if that warning is failed, an array shouldn't be returned:

    if ( IMAGETYPE_GIF == $orig_type ) {
    	if ( !imagegif( $newimage, $destfilename ) )
    		return new WP_Error('resize_path_invalid', __( 'Resize path invalid' ));

    Although my plugin has a bug where it won't realize an error has occurred there (fixing that now).

  5. Alex Mills (Viper007Bond)
    Moderator
    Plugin Author

    Posted 3 years ago #

    Try 2.1.2 and see how it works. :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic