Resize Image After Upload
-
It could be implemented using the feature to modify the size of the image before optimization, just as many plugins do to set a maximum size of width and height, to avoid uploading too large images into the site.
Example of Code:
$image = wp_get_image_editor( 'cool_image.jpg' ); if ( ! is_wp_error( $image ) ) { $image->resize( 1600, 1600, false ); $image->save( 'new_image.jpg' ); }
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Resize Image After Upload’ is closed to new replies.