If you want to save the image using the wp_get_image tool editor, you must do the following:
// load image object // the best way to use picture path instead of url, as in the example below $image = wp_get_image_editor( $_SERVER['DOCUMENT_ROOT'].'/wp-content/uploads/2015/10/image.png' ); // process image if ( ! is_wp_error( $image ) ) { $image->resize( 100, 140, true ); // save the root site irectory called new_image.png // use path to the folder where you want to save a picture $image->save( $_SERVER['DOCUMENT_ROOT'].'/new_image.png' ); }
The folder in which you are holding the image should be allowed to write, for example 755 or 777.
source share