• On the Media > Image Sizes page I’m seeing this error at the top:

    Warning: Cannot modify header information - headers already sent by (output started at [...]\wp-admin\admin-header.php:35) in [...]\wp-content\plugins\additional-image-sizes-zui\vendor\beingzoe\zui_php\ZUI\WpAdditionalImageSizes.php on line 337

    When I try to re-generate images I get a bunch of these errors:

    Warning: array_keys() expects parameter 1 to be array, null given in [...]\wp-content\plugins\additional-image-sizes-zui\vendor\beingzoe\zui_php\ZUI\WpAdditionalImageSizes.php on line 921

    That said, everything seems to work fine – just thought I’d share since I’m seeing so many error messages. I’m running this on a localhost installation. Thanks for the great plugin, this is EXACTLY what I’ve been looking for!

Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Author beingzoe

    (@beingzoe)

    Hello mmcginnis. I will be posting an update to prevent the Warning: Cannot modify header information... shortly. This was brought to my attention as a potential problem by someone else last night but I wasn’t able to get to to it today. It is a cookie to save the form settings that is causing the error on some installs. I can’t replicate the error on any of my testing or production servers and can only guess it is the “blank space” problem or a plugin pushing the headers before I would like ??

    Either way it will be resolved in a little while.

    As for the array_keys error the most recent version 0.1.6 prevented that from happening. It has to do with an empty WordPress variable having to do with intermediate image sizes created using add_image_size() (or in the case of your install not being created). I discovered that shortly after putting up 0.1.5.

    So keep an eye out for 0.1.7 to fix all your problems (if only it were really that easy ??

    Plugin Author beingzoe

    (@beingzoe)

    Okay 0.1.7 has been pushed to the repository and should show up for updating in the next 15 minutes or so. Please let me know if that fixed everything.

    Thread Starter FriendlyWP

    (@mmcginnis)

    Thanks so much, @beingzoe! 0.17 fixed the Modify Headers error. Unfortunately I’m still seeing this error when I try to regenerate images:

    Warning: array_keys() expects parameter 1 to be array, null given in [...]\wp-content\plugins\additional-image-sizes-zui\vendor\beingzoe\zui_php\ZUI\WpAdditionalImageSizes.php on line 923

    I do have one image size which is being generated via a function in my theme – maybe that has something to do with it? I’ve noticed I can’t insert that particular image size via Insert into Post.

    Thanks again,
    Michelle

    Plugin Author beingzoe

    (@beingzoe)

    Hey Michelle thank you for helping work through this. This seems very odd because the snippet it is bombing on is the attachment data from WordPress which should be a standardized format and you shouldn’t be able to reach that line of code unless you have images uploaded. And if you do then that particular array could not be null as that error is claiming.

    So before I try to “guess” what is going on there (since I can’t replicate the problem) would you be okay with me sending you a copy of the plugin that has some debug stuff output that you could send back to me and I could maybe figure out what is going on there?

    Either way would you mind pasting that function creating the image size in your theme? (If it is a lot of code for some reason use https://pastebin.com/ or a gist if you are on github) Perhaps the problem could be discovered in that function.

    Thank you again for helping me debug this. I am sure this will come up on someone’s install.

    Thread Starter FriendlyWP

    (@mmcginnis)

    Sure thing! This is called from within a copy of the twentyten_setup function:

    `// This theme uses post thumbnails
    add_theme_support( ‘post-thumbnails’ );

    if ( function_exists( ‘add_image_size’ ) ) {
    add_image_size( ‘pagewidth’, 650, 120, true );
    }`

    That “pagewidth” image size appears in the list of custom image sizes in Media > Image Sizes, but it’s italicized and not deletable. And as I said before I can’t insert it into posts.

    I’m happy to try out your debug code. I’ll email you offline at your beingzoe address so you can send it to me.

    Plugin Author beingzoe

    (@beingzoe)

    Cool. Got your email and I am putting in some debug output and will email you shortly. That is totally normal with the add_image_size() and shouldn’t be causing a problem. The way add_image_size() works they aren’t insertable via posts which is why when the original “additional image sizes” plugin quit working right with 3.0 I was heartbroken ??

    So seeing it in the list as undeletable is a good sign and only serves to make this an even stranger bug.

    You rock though for helping out. Oh and I love your “Friendly” business name.

    Hi there,

    I’m getting these errors when trying to generate copies:

    Warning: array_keys() [function.array-keys]: The first argument should be an array in […]/wp-content/plugins/additional-image-sizes-zui/vendor/beingzoe/zui_php/ZUI/WpAdditionalImageSizes.php on line 923

    Warning: array_diff() [function.array-diff]: Argument #1 is not an array in […]/wp-content/plugins/additional-image-sizes-zui/vendor/beingzoe/zui_php/ZUI/WpAdditionalImageSizes.php on line 923

    no new images are created.

    When I go in to add an image in the media library, no other sizes are created.

    I am using WordPress 3.1 and Additional Image Sizes (zui) v0.1.7

    Plugin Author beingzoe

    (@beingzoe)

    My apologies for not getting updates posted. Some stuff came up in my personal life that precluded focusing on this. I believe I have the solution and will post and make the necessary changes over the weekend.

    Again my sincere apologies for not getting back to you all sooner.

    Any progress on this? I’m also getting the following error… : (

    Thanks for your help. : )

    Warning: array_keys() expects parameter 1 to be array, null given in /home/jonnyleaf/domain/wp-content/plugins/additional-image-sizes-zui/vendor/beingzoe/zui_php/ZUI/WpAdditionalImageSizes.php on line 925

    Warning: array_diff() [function.array-diff]: Argument #1 is not an array in /home/jonnyleaf/domain/wp-content/plugins/additional-image-sizes-zui/vendor/beingzoe/zui_php/ZUI/WpAdditionalImageSizes.php on line 925

    Hi there,

    I also tried today this plugin and unfortunately got: “Warning: array_keys() [function.array-keys]: The first argument should be an array in /home2/xxxxx1/public_html/wp-content/plugins/additional-image-sizes-zui/vendor/beingzoe/zui_php/ZUI/WpAdditionalImageSizes.php on line 923”
    when trying to generate copies of new size (?)

    THANK YOU!
    Jimmy

    Re-Hello,

    I don’t know if this can help but I use a WP-theme called Cooolzine and there was some exchange about this problem between a user and the theme author. Maybe that could help (?)
    https://themeforest.net/item/cooolzine-magazine-wordpress-edition/discussion/115116

    Thanks again for your concern ??

    Did some debugging and have some clue.
    Static function “simulate_image_make_intermediate_size” on WpAdditionalImageSizes.php calls “image_resize_dimensions” function from wp-includes/media.php .

    Note the following lines:

    // if the resulting image would be the same size or larger we don't want to resize it
    	if ( $new_w >= $orig_w && $new_h >= $orig_h )
    		return false;

    In my case, the comparission is true so the returned value is false.

    Since there isn’t anything bad happening. The way I found to stop those anoying warning message was to add conditional on line 923 in WpAdditionalImageSizes.php .

    The code before:
    $metadata_sizes_not_in_current_all_sizes = array_diff( array_keys($metadata['sizes']), $sizes_to_check_plus_additional ); //sizes_to_check

    The code after:
    if($metadata['sizes']) $metadata_sizes_not_in_current_all_sizes = array_diff( array_keys($metadata['sizes']), $sizes_to_check_plus_additional ); //sizes_to_check

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘[Plugin: Additional image sizes (zui)] Getting errors on 3.1 install’ is closed to new replies.