Adding images to sets and resizing images on upload in 5.7

Permalink
Hi everyone, I'm getting close to launch of my first 5.7 site and just have a few questions.

First, is there a way to auto add images to sets on upload from the block controller? I have, for example, a promotions block and would like any images a user uploads within that block to be assigned to the "Promotions" set. Otherwise the file manager will become a mess as I have several other blocks uploading images of different kinds.

I tried the example from the forum for 5.6 but just gave an error. Was trying:

use Concrete\Core\File\Set;
public function save($args){
      $fID = $args['fID'];
      $fs = Set::getByName('Promotions');
      $fs->addFileToSet($fID);
      ...
                parent::save($args);
}



Secondly, I know 5.7 ships with an image editor, but I haven't found any examples of using it. I'd like to have images auto-resized and cropped to fit my block design on upload, so the user doesn't have to cut the image him/her self. Is it possible? Could anyone give a short example of a center crop / resize?

Thanks!