WordPress.org

Ready to get started?Download WordPress

Forums

Post Thumbnail Editor
[resolved] Error with non-fixed image sizes (19 posts)

  1. andr50
    Member
    Posted 2 years ago #

    Howdy, the plugin has been working great, until I stumbled across a new bug (Not so much a bug, more like me using it to do something...unordinary, and it failing on it)

    I have a custom image size with only one fixed dimension (add_image_size( 'header-slider-450', 0, 400, true );)

    When I try to resize an image using that type, I get an error:

    [ERROR] - Resize path invalid: /nas/wp/www/cluster-1062/cumberland/wp-content/uploads/ptetmp/1089/cumberland_munich-02-0x400.jpg,[ERROR] - Error writing image: header-slider-450 to '/nas/wp/www/cluster-1062/cumberland/wp-content/uploads/ptetmp/1089/cumberland_munich-02-0x400.jpg',[ERROR] - No images processed

    The rest of my images resize fine, just not that specific one.

    (here's the debug log on a different image)

    20120409 16:51:03 - [string] ===== STARTUP PHP MESSAGES =====
    20120409 16:51:03 - [string] ===== SERVER LOG =====
    20120409 16:51:03 - [string] [DEBUG] - PARAMETERS: Array
    (
        [action] => pte_ajax
        [pte-action] => launch
        [id] => 1105
    )
    
    20120409 16:51:03 - [string] [DEBUG] - USER-AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:11.0) Gecko/20100101 Firefox/11.0
    20120409 16:51:03 - [string] [DEBUG] - WORDPRESS: 3.3.1
    20120409 16:51:03 - [string] [DEBUG] - SIZER: 0.13333333
    20120409 16:51:03 - [string] [DEBUG] - META: Array
    (
        [width] => 2400
        [height] => 3000
        [hwstring_small] => height='96' width='76'
        [file] => 2012/04/Alton_Bench-1_high.jpg
        [sizes] => Array
            (
                [thumbnail] => Array
                    (
                        [file] => Alton_Bench-1_high-150x150.jpg
                        [width] => 150
                        [height] => 150
                    )
    
                [medium] => Array
                    (
                        [file] => Alton_Bench-1_high-240x300.jpg
                        [width] => 240
                        [height] => 300
                    )
    
                [large] => Array
                    (
                        [file] => Alton_Bench-1_high-819x1024.jpg
                        [width] => 819
                        [height] => 1024
                    )
    
                [page-header-1200] => Array
                    (
                        [file] => Alton_Bench-1_high-1200x400.jpg
                        [width] => 1200
                        [height] => 400
                    )
    
                [home-slide-960] => Array
                    (
                        [file] => Alton_Bench-1_high-960x635.jpg
                        [width] => 960
                        [height] => 635
                    )
    
                [related-thumb-128] => Array
                    (
                        [file] => Alton_Bench-1_high-128x128.jpg
                        [width] => 128
                        [height] => 128
                    )
    
                [material-slide-365] => Array
                    (
                        [file] => Alton_Bench-1_high-365x365.jpg
                        [width] => 365
                        [height] => 365
                    )
    
                [material-swatch-70] => Array
                    (
                        [file] => Alton_Bench-1_high-70x70.jpg
                        [width] => 70
                        [height] => 70
                    )
    
                [slideshow-swatch-40] => Array
                    (
                        [file] => Alton_Bench-1_high-40x40.jpg
                        [width] => 40
                        [height] => 40
                    )
    
                [header-slider-450] => Array
                    (
                        [file] => Alton_Bench-1_high-320x400.jpg
                        [width] => 320
                        [height] => 400
                    )
    
                [popup-background-480] => Array
                    (
                        [file] => Alton_Bench-1_high-480x400.jpg
                        [width] => 480
                        [height] => 400
                    )
    
                [post-thumbnail] => Array
                    (
                        [file] => Alton_Bench-1_high-140x140.jpg
                        [width] => 140
                        [height] => 140
                    )
    
                [detail] => Array
                    (
                        [file] => Alton_Bench-1_high-75x75.jpg
                        [width] => 75
                        [height] => 75
                    )
    
            )
    
        [image_meta] => Array
            (
                [aperture] => 0
                [credit] => Christopher Barrett
                [camera] => P 65+
                [caption] =>
                [created_timestamp] => 1264595056
                [copyright] => © 2010 Christopher Barrett
                [focal_length] => 0
                [iso] => 50
                [shutter_speed] => 5.99994801144
                [title] =>
            )
    
    )
    
    20120409 16:51:04 - [string] ===== REFLOW =====
    20120409 16:51:04 - [string] ===== FIXING THICKBOX =====
    20120409 16:51:04 - [string] THICKBOX: 670 x 722
    20120409 16:51:04 - [string] WINDOW WIDTH: 780
    20120409 16:51:04 - [string] ===== REFLOW =====
    20120409 16:51:04 - [string] ===== FIXING THICKBOX =====
    20120409 16:51:04 - [string] WINDOW WIDTH: 780
    20120409 16:51:12 - [string] ===== SETTING ASPECTRATIO: 0:1 =====
    20120409 16:51:18 - [string] ===== RESIZE-IMAGES =====
    20120409 16:51:18 - [object] {"id":"1105","action":"pte_ajax","pte-action":"resize-images","pte-sizes[]":["header-slider-450"],"x":202,"y":1462,"w":2152,"h":1042}
    20120409 16:51:19 - [string] ===== RESIZE-IMAGES SUCCESS =====
    20120409 16:51:19 - [object] {"error":["[ERROR] - Resize path invalid: /nas/wp/www/cluster-1062/cumberland/wp-content/uploads/ptetmp/1105/Alton_Bench-1_high-0x400.jpg","[ERROR] - Error writing image: header-slider-450 to '/nas/wp/www/cluster-1062/cumberland/wp-content/uploads/ptetmp/1105/Alton_Bench-1_high-0x400.jpg'","[ERROR] - No images processed"],"log":["[DEBUG] - PARAMETERS: Array\n(\n    [id] => 1105\n    [action] => pte_ajax\n    [pte-action] => resize-images\n    [pte-sizes] => Array\n        (\n            [0] => header-slider-450\n        )\n\n    [x] => 202\n    [y] => 1462\n    [w] => 2152\n    [h] => 1042\n)\n","[DEBUG] - BASE FILE DIMENSIONS/INFO: Array\n(\n    [0] => 2400\n    [1] => 3000\n    [2] => 2\n    [3] => width=\"2400\" height=\"3000\"\n    [bits] => 8\n    [channels] => 3\n    [mime] => image/jpeg\n)\n","[DEBUG] - Array\n(\n    [type] => 2\n    [dst_x] => 0\n    [dst_y] => 0\n    [dst_w] => 0\n    [dst_h] => 400\n    [src_x] => 202\n    [src_y] => 1462\n    [src_w] => 2152\n    [src_h] => 1042\n)\n","[ERROR] - Resize path invalid: /nas/wp/www/cluster-1062/cumberland/wp-content/uploads/ptetmp/1105/Alton_Bench-1_high-0x400.jpg","[ERROR] - Error writing image: header-slider-450 to '/nas/wp/www/cluster-1062/cumberland/wp-content/uploads/ptetmp/1105/Alton_Bench-1_high-0x400.jpg'","[ERROR] - No images processed"]}
    20120409 16:51:19 - [string] ===== SERVER LOG =====
    20120409 16:51:19 - [string] [DEBUG] - PARAMETERS: Array
    (
        [id] => 1105
        [action] => pte_ajax
        [pte-action] => resize-images
        [pte-sizes] => Array
            (
                [0] => header-slider-450
            )
    
        [x] => 202
        [y] => 1462
        [w] => 2152
        [h] => 1042
    )
    
    20120409 16:51:19 - [string] [DEBUG] - BASE FILE DIMENSIONS/INFO: Array
    (
        [0] => 2400
        [1] => 3000
        [2] => 2
        [3] => width="2400" height="3000"
        [bits] => 8
        [channels] => 3
        [mime] => image/jpeg
    )
    
    20120409 16:51:19 - [string] [DEBUG] - Array
    (
        [type] => 2
        [dst_x] => 0
        [dst_y] => 0
        [dst_w] => 0
        [dst_h] => 400
        [src_x] => 202
        [src_y] => 1462
        [src_w] => 2152
        [src_h] => 1042
    )
    
    20120409 16:51:19 - [string] [ERROR] - Resize path invalid: /nas/wp/www/cluster-1062/cumberland/wp-content/uploads/ptetmp/1105/Alton_Bench-1_high-0x400.jpg
    20120409 16:51:19 - [string] [ERROR] - Error writing image: header-slider-450 to '/nas/wp/www/cluster-1062/cumberland/wp-content/uploads/ptetmp/1105/Alton_Bench-1_high-0x400.jpg'
    20120409 16:51:19 - [string] [ERROR] - No images processed

    Thanks again for the awesome plugin!

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

  2. sewpafly
    Member
    Plugin Author

    Posted 2 years ago #

    Interestingly enough, I think I have already fixed this error but the fix hasn't been pushed out to wordpress.org yet. If you're comfortable with gut you can pull the latest master branch and that should work. Otherwise you can download a zip file from github.com/sewpafly/post-thumbnail-editor. Let me know if you still have problems and I can look into it further.

  3. andr50
    Member
    Posted 2 years ago #

    I pulled the most recent zip down, but sadly it seems to have the error still:

    [ERROR] - Invalid derived dimensions: 0 x 400,[ERROR] - Resize path invalid: /nas/wp/www/cluster-1062/cumberland/wp-content/uploads/ptetmp/489/Christina_Table-5_high-0x400.jpg,[ERROR] - Error writing image: header-slider-450 to '/nas/wp/www/cluster-1062/cumberland/wp-content/uploads/ptetmp/489/Christina_Table-5_high-0x400.jpg',[ERROR] - No images processed
  4. sewpafly
    Member
    Plugin Author

    Posted 2 years ago #

    Okay, I'll have a fix for this later this week (1.0.5). Sorry it's taken me so long to get back to you.

  5. sewpafly
    Member
    Plugin Author

    Posted 2 years ago #

    Actually, if you change your add_image_size to add_image_size( 'header-slider-450', 0, 400, false ); It should fix the problem immediately. Maybe I'm missing something but it seems that if you set the crop value to true you are telling wordpress that you want an image of 0x400 every time.

  6. andr50
    Member
    Posted 2 years ago #

    Ugh, didn't even realize that was still set to auto-crop. Sometimes stuff gets missed when the spec changes mid-project (slider-450 is ... 400 tall, haha)

    Changed it, but now the plugin is throwing an even bigger error:

    [ERROR] - Invalid derived dimensions: 0 x 0,[ERROR] - Resize path invalid: /nas/wp/www/staging/cumberland/wp-content/uploads/ptetmp/1310/Sirra_Conference_Detail_02-0x0.jpg,[ERROR] - Error writing image: header-slider-450 to '/nas/wp/www/staging/cumberland/wp-content/uploads/ptetmp/1310/Sirra_Conference_Detail_02-0x0.jpg',[ERROR] - No images processed,[WARNING] - Buffered output: <br />
    <b>Warning</b>:  imagecreatetruecolor() [<a href='function.imagecreatetruecolor'>function.imagecreatetruecolor</a>]: Invalid image dimensions in <b>/nas/wp/www/staging/cumberland/wp-includes/media.php</b> on line <b>1010</b><br />
    <br />
    <b>Warning</b>:  imagecopyresampled() expects parameter 1 to be resource, boolean given in <b>/nas/wp/www/staging/cumberland/wp-content/plugins/sewpafly-post-thumbnail-editor-7b3016f/php/functions.php</b> on line <b>381</b><br />
    <br />
    <b>Warning</b>:  imagejpeg() expects parameter 1 to be resource, boolean given in <b>/nas/wp/www/staging/cumberland/wp-content/plugins/sewpafly-post-thumbnail-editor-7b3016f/php/functions.php</b> on line <b>418</b><br />
  7. sewpafly
    Member
    Plugin Author

    Posted 2 years ago #

    Did you refresh all your pages? I saw something similar, refreshed and things seemed to work well.

  8. andr50
    Member
    Posted 2 years ago #

    I just tried a completely different browser to make sure there wasn't anything cached, and I'm seeing the same error.

  9. sewpafly
    Member
    Plugin Author

    Posted 2 years ago #

    Does every thumbnail size fail or just this one?

    Can you pastebin the log for me?

  10. andr50
    Member
    Posted 2 years ago #

    Sure can, it's definitely only that size it's having issues with.

    Pastebin

  11. sewpafly
    Member
    Plugin Author

    Posted 2 years ago #

    Can you share how header slider is created? (Are you still using the 1.0.5-alpha version of PTE from github?)

  12. andr50
    Member
    Posted 2 years ago #

    Yep, still using the 1.0.5.

    Not sure what you want to know about the creation of it - It's just being used from add image size from above (Changed to false on the crop), and using an attachment plugin to attach those images to a post.

  13. sewpafly
    Member
    Plugin Author

    Posted 2 years ago #

    Yeah, I don't know what else to try,

    I used the following:

    // Test image sizes
    add_image_size( 'limit-height', 0, 400, false );
    add_image_size( 'limit-width', 400, 0, false );
    add_image_size( 'header-slider-450', 0, 400, false );

    But it doesn't duplicate the problem... What happens if you upload a new image and try to modify it on that one?

  14. andr50
    Member
    Posted 2 years ago #

    Just tried with a newly uploaded image:

    http://dpastey.appspot.com//a6NT/

    I'll try next using the 'limit-height' image size you pasted above, and see what happens.

  15. andr50
    Member
    Posted 2 years ago #

    And here's the pastebin from the 'limit-height' size:

    http://dpastey.appspot.com//Y994/

    Sadly, same error

  16. sewpafly
    Member
    Plugin Author

    Posted 2 years ago #

    I think I may have duplicated the problem.

  17. sewpafly
    Member
    Plugin Author

    Posted 2 years ago #

    You can try to download the latest version from github now. Details here.

  18. andr50
    Member
    Posted 2 years ago #

    That worked. I believe you have fixed it sir.

  19. sewpafly
    Member
    Plugin Author

    Posted 2 years ago #

    Phew. Now I have to bring the changes over to wordpress.org. Thanks for your help in tracking this bug down!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic