/*
* If the file doesn't exist, attempt a URL fopen on the src link.
* This can occur with certain file replication plugins.
* Keep the original file path to get a modified name later.
*/
$image_file_to_edit =
$image_file;
if ( !
file_exists( $image_file_to_edit ) ) { $image_file_to_edit =
_load_image_to_edit_path( $attachment_id );
} $image_editor =
wp_get_image_editor( $image_file_to_edit );
if ( is_wp_error( $image_editor ) ) { return new WP_Error( 'rest_unknown_image_file_type',
__( 'Unable to edit this image.'
),
array
( 'status' => 500
) );
} foreach ( $modifiers as $modifier ) { $args =
$modifier['args'
];