docs: function crop_centered(options) {
      var w = options.source.w;
      var h = options.source.h;
      var tw = options.target.w;
      var th = options.target.h;
      var crop = new_crop_rect();
  
      if (tw / th < w / h) {
          crop.w = h * tw / th;
          crop.h = h;
          crop.x = w / 2 - crop.w / 2;
          crop.y = 0;
      } else {
          crop.w = w;
          crop.h = w / (tw / th);
          crop.x = 0;
          crop.y = h / 2 - crop.h / 2;
      }
  
      return floor_crop_rect(crop);
  }