nevermind found 🙂
Thanks for the awesome function
/**
* Resize an image using the WP_Image_Editor.
*
* @param string $file Image file path.
* @param int $max_w Maximum width to resize to.
* @param int $max_h Maximum height to resize to.
* @param bool $crop Optional. Whether to crop image or resize.
* @param string $suffix Optional. File suffix.
* @param string $dest_path Optional. New image file path.
* @param int $jpeg_quality Optional, default is 82. Image quality level (1-100).
* @return mixed WP_Error on failure. String with new destination path.
*/
imsanity_image_resize( $file, $max_w, $max_h, $crop = false, $suffix = null, $dest_path = null, $jpeg_quality = 82 )
That’s the one, glad you found it!