I needs to upload images in my plugin and use wp.media for this task.
According to https://codex.wordpress.org/Javascript_Reference/wp.media
Its work, but I needs to have “Select and Crop” option in media library after upload my image with custom size.
I was see this in default theme in appearence custom header image, but can’t understand how I can use this in my plugin with wp.media js?
This my not be better solution but work in wordpress 🙂
i use Thumbnail Crop Position and Simple Image Sizes for that 🙂
Good luck! 🙂
See my answer posted here that does Select and Crop using the Media Library on a theme options page. You can use it as a starting point for getting it to work in a plugin:
https://wordpress.stackexchange.com/questions/281760/using-media-uploader-to-select-image-of-specific-size-enforce-cropper/302962#302962