WordPress.org

Ready to get started?Download WordPress

Forums

Post Thumbnail Editor
[resolved] errors (26 posts)

  1. Sjeiti
    Member
    Posted 1 year ago #

    I'm getting a few errors (I've removed the full path for clarity).

    The first is on initialisation of the popup after clicking on thumbnails from the media library:
    Notice: Use of undefined constant size_information - assumed 'size_information' in (...)\wp-content\plugins\post-thumbnail-editor\php\functions.php on line 255

    The second occurs in the ajax callback after doing a crop and clicking 'create thumbnails':
    Notice: Undefined offset: 1 in (...)\wp-content\plugins\post-thumbnail-editor\php\log.php on line 83

    Notice: Undefined index: log in (...)\wp-content\plugins\post-thumbnail-editor\php\functions.php on line 57
    {"thumbnails":{"thumbnail":{"url":"(...)\/wp-content\/uploads\/ptetmp\/199\/463226253TUKCrS_fs-2-150x150.jpg","file":"463226253TUKCrS_fs-2-150x150.jpg"},"medium":{"url":"(...)\/wp-content\/uploads\/ptetmp\/199\/463226253TUKCrS_fs-2-300x273.jpg","file":"463226253TUKCrS_fs-2-300x273.jpg"},"large":{"url":"(...)\/wp-content\/uploads\/ptetmp\/199\/463226253TUKCrS_fs-2-1024x931.jpg","file":"463226253TUKCrS_fs-2-1024x931.jpg"}},"pte-nonce":"9bf22a6cca","pte-delete-nonce":"fca2c18feb","error":["[WARNING] - Buffered output:
    \nNotice<\/b>: wp_load_image is niet meer in gebruik<\/strong> sinds versie3.5! Gebruik in plaats daarvan wp_get_image_editor(). in (...)\\wp-includes\\functions.php<\/b> on line 2824<\/b>
    \n"]}

    Translation of that last part is: 'wp_load_image is no longer in use since version 3.5! Use wp_get_image_editor() instead'

    http://wordpress.org/extend/plugins/post-thumbnail-editor/

  2. sewpafly
    Member
    Plugin Author

    Posted 1 year ago #

    I'm not sure where you are getting that error message from. I just verified that my code does not call wp_load_image, so if that's happening it's either from a different plugin, or a corrupted wordpress install.

    At least that's what I can tell without more information... If you are willing you could follow the steps below to get some additional debugging logs that I can look at.

    1. Go to Settings -> Post Thumbnail Editor and disable thickbox and enable debugging.
    2. Start PTE on one of your images
    3. Try to crop it. If the process doesn't work the way it should, describe what you did and what you were expecting to happen, and then use the debug tab to get a copy of the logs that I can look at.
  3. Sjeiti
    Member
    Posted 1 year ago #

    Ok...

    adjusted settings
    went to media library
    selected 'Thumbnails'
    in popup iframe:
    clicked 'Select: All' to check all checboxes
    dragged a selection in the image
    clicked 'Create thumbnails'
    waited for gray overlay to disappear
    nothing changed so I then tried again to drag a selection
    and clicked 'Create thumbnails'

    The iframe showed exactly the same msg at the top... and the XHR had the same error in the returned JSON.

    Here's the log from the error tab:

    20130117 16:59:17 - [string] ===== STARTUP PHP MESSAGES =====
    20130117 16:59:17 - [string] ===== SERVER LOG =====
    20130117 16:59:17 - [string] [DEBUG] - PARAMETERS: Array
    (
    [action] => pte_ajax
    [pte-action] => launch
    [id] => 199
    )

    20130117 16:59:17 - [string] [DEBUG] - PTE-VERSION: 1.0.7
    20130117 16:59:17 - [string] [DEBUG] - USER-AGENT: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17
    20130117 16:59:17 - [string] [DEBUG] - WORDPRESS: 3.5
    20130117 16:59:17 - [string] [DEBUG] - SIZER: 0.22547914
    20130117 16:59:17 - [string] [DEBUG] - SIZES: Array
    (
    [thumbnail] => Array
    (
    [width] => 150
    [height] => 150
    [crop] => 1
    [current] => Array
    (
    [file] => 463226253TUKCrS_fs-2-150x150.jpg
    [width] => 150
    [height] => 150
    [crop] => 1
    [path] => 2013/01/463226253TUKCrS_fs-2-150x150.jpg
    [url] => http://localhost/test/wordpress/wp-content/uploads/2013/01/463226253TUKCrS_fs-2-150x150.jpg
    )

    )

    [medium] => Array
    (
    [width] => 300
    [height] => 300
    [crop] =>
    [current] => Array
    (
    [file] => 463226253TUKCrS_fs-2-300x203.jpg
    [width] => 300
    [height] => 203
    [mime-type] => image/jpeg
    [path] => 2013/01/463226253TUKCrS_fs-2-300x203.jpg
    [url] => http://localhost/test/wordpress/wp-content/uploads/2013/01/463226253TUKCrS_fs-2-300x203.jpg
    )

    )

    [large] => Array
    (
    [width] => 1024
    [height] => 1024
    [crop] =>
    [current] => Array
    (
    [file] => 463226253TUKCrS_fs-2-1024x693.jpg
    [width] => 1024
    [height] => 693
    [mime-type] => image/jpeg
    [path] => 2013/01/463226253TUKCrS_fs-2-1024x693.jpg
    [url] => http://localhost/test/wordpress/wp-content/uploads/2013/01/463226253TUKCrS_fs-2-1024x693.jpg
    )

    )

    )

    20130117 16:59:19 - [string] ===== REFLOW =====
    20130117 16:59:19 - [string] ===== FIXING THICKBOX =====
    20130117 16:59:19 - [string] WINDOW WIDTH: 762
    20130117 16:59:34 - [string] ===== SETTING ASPECTRATIO: 1:1 =====
    20130117 16:59:44 - [string] ===== RESIZE-IMAGES =====
    20130117 16:59:44 - [object] {"id":"199","action":"pte_ajax","pte-action":"resize-images","pte-sizes[]":["thumbnail","medium","large"],"x":1130,"y":332,"w":616,"h":616}
    20130117 17:00:25 - [string] ===== RESIZE-IMAGES =====
    20130117 17:00:25 - [object] {"id":"199","action":"pte_ajax","pte-action":"resize-images","pte-sizes[]":["thumbnail","medium","large"],"x":1237,"y":350,"w":536,"h":536}
    20130117 17:02:10 - [string] ===== REFLOW =====
    20130117 17:02:10 - [string] ===== FIXING THICKBOX =====
    20130117 17:02:10 - [string] WINDOW WIDTH: 764
    20130117 17:02:10 - [string] ===== REFLOW =====
    20130117 17:02:10 - [string] ===== FIXING THICKBOX =====
    20130117 17:02:10 - [string] WINDOW WIDTH: 766
    20130117 17:02:14 - [string] ===== REFLOW =====
    20130117 17:02:14 - [string] ===== FIXING THICKBOX =====
    20130117 17:02:14 - [string] WINDOW WIDTH: 762
    20130117 17:02:14 - [string] ===== REFLOW =====
    20130117 17:02:14 - [string] ===== FIXING THICKBOX =====
    20130117 17:02:14 - [string] WINDOW WIDTH: 762

  4. sewpafly
    Member
    Plugin Author

    Posted 1 year ago #

    Ok, try changing line 255 of php/functions.php from this:

    $logger->debug( "SIZES: " . print_r(${size_information}, true) );

    to this:

    $logger->debug( "SIZES: " . print_r($size_information, true) );

    Does this change anything?

  5. sdaweb
    Member
    Posted 1 year ago #

    Having the same issue. I changed that line of PHP to
    $logger->debug( "SIZES: " . print_r($size_information, true) );
    but nothing changed.

    I make my selection and click "Create Thumbnails" button. The loading icon comes up then goes away, but no success message and no change to the thumbnail I needed edited.

    Thoughts

  6. sewpafly
    Member
    Plugin Author

    Posted 1 year ago #

    OK, pretty sure that the problem is in the javascript then (the earlier messages had me thinking it was in the PHP). It looks like you are using chrome, so could you load the PTE page and press ctrl+shift+j? This should open the javascript console. The output should look similar to what you see on the debug tab that you pasted here earlier, but I need you to look specifically for anything in red.

    If you don't see anything, leave this window up and go back to the PTE page and try to crop your thumbnail. Look for anything in red to appear in the console, and then report back.

    Thanks

  7. sdaweb
    Member
    Posted 1 year ago #

    I'm using Firefox.

    This is the exact error I'm getting:

    Notice: Use of undefined constant size_information - assumed 'size_information' in [shortened URL string]/wp-content/plugins/post-thumbnail-editor/php/functions.php on line 255

    I have Firebug installed and I'm not getting any JavaScript errors.

  8. sewpafly
    Member
    Plugin Author

    Posted 1 year ago #

    I'm a little confused now... I don't understand why you are getting that notice... What version of php are you running? On what OS? Do you see the call $size_information = pte_get_all_alternate_size_information( $id ); on line 229 of functions.php?

    These appear to be different errors than you stated above... Did the last change make this error appear? If you revert the change does it go back to the previous problem?

  9. sdaweb
    Member
    Posted 1 year ago #

    I guess my issue is different than @Sjeiti.

    This is what I'm using (locally):
    PHP Version 5.3.6
    OS X Snow Leopard
    Browser: Firefox 18.0.1

    On line 229 it reads:

    $size_information = pte_get_all_alternate_size_information( $id );

    When I click the "Thumbnails" link the Media Library to activate the Thickbox overlay, this is what I see:

    Screenshot

    Any other thoughts?

  10. sewpafly
    Member
    Plugin Author

    Posted 1 year ago #

    @Sjeiti - I turned on WP_DEBUG and saw many of the same issues. The latest fixes can be found here.

    @sdaweb - Can you try installing this latest version and letting me know if you still see some issues. (Also disable thickbox).

    Thanks!

  11. sdaweb
    Member
    Posted 1 year ago #

    I uploaded/installed the alpha version of your plugin. Not sure how to disable thickbox, since this comes default with wordpress. When trying to use the alpha-version of the plugin, the lightbox (thickbox) pops up and I can't get passed the loading screen. I noticed the red "DEBUG" in the right corner.

    Screenshot

  12. sdaweb
    Member
    Posted 1 year ago #

    I noticed this on the Thickbox Codex:

    Note: As of WordPress 3.5, the "Media" button for WordPress's post editor no longer utilizes ThickBox, but instead uses a custom Javascript modal. ThickBox is still used for other WordPress components and may still be used by developers.

    Not sure if that really applies to your plugin, though.

  13. sewpafly
    Member
    Plugin Author

    Posted 1 year ago #

    Disable thickbox in Settings → Post Thumbnail Editor.

    The next step is to use google chrome and press ctrl+shift+J and look for any errors in the console. (Also firefox with the firebug extension would work). This should provide me with some more information.

  14. sdaweb
    Member
    Posted 1 year ago #

    I'm not sure where you're at, but maybe we could connect via Skype to hash this out. Let me know.

    This is what I see when clicking the "Thumbnails" link:
    ReferenceError: log is not defined
    ReferenceError: pte is not defined.
    Screenshot

  15. sewpafly
    Member
    Plugin Author

    Posted 1 year ago #

  16. sdaweb
    Member
    Posted 1 year ago #

    Here we go:

    20130125 17:26:51 - [string] ===== STARTUP PHP MESSAGES =====
    20130125 17:26:51 - [string] ===== SERVER LOG =====
    20130125 17:26:51 - [string] [DEBUG] - PARAMETERS: Array
    (
        [action] => pte_ajax
        [pte-action] => launch
        [id] => 164
        [TB_iframe] => true
        [height] => 550
        [width] => 750
    )
    
    20130125 17:26:51 - [string] [WARNING] - Couldn't find or generate metadata for image: 164-large
    20130125 17:26:51 - [string] [DEBUG] - PTE-VERSION: 2.0.0-alpha
    20130125 17:26:51 - [string] [DEBUG] - USER-AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:18.0) Gecko/20100101 Firefox/18.0
    20130125 17:26:51 - [string] [DEBUG] - WORDPRESS: 3.5.1
    20130125 17:26:51 - [string] [DEBUG] - SIZER: 0.40000000
    20130125 17:26:51 - [string] [DEBUG] - SIZES: Array
    (
        [thumbnail] => Array
            (
                [width] => 150
                [height] => 150
                [crop] => 1
                [current] => Array
                    (
                        [file] => goggles-150x150.jpg
                        [width] => 150
                        [height] => 150
                        [path] => 2012/11/goggles-150x150.jpg
                        [url] => http://localhost/PoolMaster/www/wp-content/uploads/2012/11/goggles-150x150.jpg
                    )
    
            )
    
        [medium] => Array
            (
                [width] => 300
                [height] => 300
                [crop] =>
                [current] => Array
                    (
                        [file] => goggles-300x225.jpg
                        [width] => 300
                        [height] => 225
                        [path] => 2012/11/goggles-300x225.jpg
                        [url] => http://localhost/PoolMaster/www/wp-content/uploads/2012/11/goggles-300x225.jpg
                    )
    
            )
    
        [large] => Array
            (
                [width] => 1024
                [height] => 1024
                [crop] =>
                [current] =>
            )
    
        [shop_thumbnail] => Array
            (
                [width] => 50
                [height] => 50
                [crop] => 1
                [current] => Array
                    (
                        [file] => goggles-90x90.jpg
                        [width] => 90
                        [height] => 90
                        [path] => 2012/11/goggles-90x90.jpg
                        [url] => http://localhost/PoolMaster/www/wp-content/uploads/2012/11/goggles-90x90.jpg
                    )
    
            )
    
        [shop_catalog] => Array
            (
                [width] => 150
                [height] => 150
                [crop] => 1
                [current] => Array
                    (
                        [file] => goggles-150x150.jpg
                        [width] => 150
                        [height] => 150
                        [path] => 2012/11/goggles-150x150.jpg
                        [url] => http://localhost/PoolMaster/www/wp-content/uploads/2012/11/goggles-150x150.jpg
                    )
    
            )
    
        [shop_single] => Array
            (
                [width] => 300
                [height] => 300
                [crop] => 1
                [current] => Array
                    (
                        [file] => goggles-300x300.jpg
                        [width] => 300
                        [height] => 300
                        [path] => 2012/11/goggles-300x300.jpg
                        [url] => http://localhost/PoolMaster/www/wp-content/uploads/2012/11/goggles-300x300.jpg
                    )
    
            )
    
    )
    
    20130125 17:26:51 - [string] ===== REFLOW =====
    20130125 17:26:51 - [string] WINDOW WIDTH: 2560
  17. sdaweb
    Member
    Posted 1 year ago #

  18. sdaweb
    Member
    Posted 1 year ago #

    And then, trying to use the plugin on 3 different images:

    Screenshot

    Looks like one thumbnail got cropped correctly. The others... not so much.

    :)

    Seems to work, 1 image at a time.

  19. sewpafly
    Member
    Plugin Author

    Posted 1 year ago #

    The pastebin doesn't have any of the debug statements from the actual crop process. If you could run all the way to step 3 and then get the logs I might be able to see the problem.

  20. sdaweb
    Member
    Posted 1 year ago #

    Did you notice in the screenshot what happens when trying to create multiple thumbnails? 1 or 2 thumbnails are perfect, but some other ones are black: Screenshot This is at stage 2 and I'm not getting any errors in the console at this point.

    Clicking okay and moving onto stage 3, still didn't get any console errors, but the images are saved — even the black ones. Clicked the debug button and got this: Pastebin.

    Hope that helps. :)

  21. sewpafly
    Member
    Plugin Author

    Posted 1 year ago #

    I duplicated the error... I'll let you know when I have a fix for it!

  22. sdaweb
    Member
    Posted 1 year ago #

    Awesome! Thanks!

  23. sewpafly
    Member
    Plugin Author

    Posted 1 year ago #

  24. sdaweb
    Member
    Posted 1 year ago #

    So far, seems to be working perfectly! :)

  25. Sjeiti
    Member
    Posted 1 year ago #

    Cool... works like a charm :)

    Let us know in this thread when you commit v2 so we can vote that it works.

  26. sewpafly
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks, I will!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.