3

I have a problem when uploading large images: images larger then (approx) 2000x2000 aren't generating thumbnails. The file is uploaded fine, but no resized version are generated. No errors are shown. If I upload a smaller one, everything works fine and smaller sizes are generated (ex: test-100x100.jpg)

I've contacted my hosting support because I thought this would be a php-gd problem, but support said everything was fine. Here what we have ruled out:

  • Permission problems
  • Out of disk space
  • Out of memory (works fine on a server with half the amount of memory)
  • Max upload limit (in WP and on server)

We even tried another server with the exact same setup, and everything works fine here.

  • I use a clean copy of the latest version WP. no plugins activated
  • I've tried plugins which regenerates thumbnails, but even here all processes end successfully without errors, but no resizing was done.

So I'm no trying to manually debug WP, and I'm having trouble finding the exact file where uploaded files are handled and resized.

If found some classes in /wp-includes:

  • class-wp-image-editor.php
  • class-wp-image-editor-gd.php

But it seems none of them are used during an upload. ( I've put die() in various functions)

  • Maybe stuff runs into a timeout? – kaiser Sep 23 '13 at 11:39
  • Last I remember WP was running some related functions with @ error suppression, you might need something like xdebug scream or custom error handler to really get to errors. – Rarst Sep 23 '13 at 11:56
1

You can add a filter to wp_image_editors and see what editor is in use (GD or Imagick). In a past project I've extended the resize routines on both GD, and Imagick, and the methods responsible for resize are WP_Image_Editor_Imagick->crop() and WP_Image_Editor_GD->_resize().

Note that WP_Image_Editor_GD->resize() is just a wrapper.

The process it's run on ajax, but you can use var_dump() to debug it - it will show up on uploaded image messages, the box with progress bar and all.

add_filter( 'wp_image_editors', 'wp23092013_extend_image_editor' );

function wp23092013_extend_image_editor( $editor ) {
    var_dump( $editor );
    return $editor;
}

Happy debugging ;)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.