wp_generate_attachment_metadata() should not call WP_Image_Editor if there's nothing to resize
|Reported by:||mdawaffe||Owned by:||nacin|
wp_generate_attachment_metadata() calls WP_Image_Editor::multi_resize() to create the intermediate sizes of the image.
If there are no sizes to create, WP_Image_Editor::get_instance() should not be called. It will not be used for anything and is a waste of resources.
If it is called, and the image is very large, a needless Out of Memory Fatal Error can result.