code: public static @NotNull CropDimension fromCropString(@NotNull String cropString) {
      if (StringUtils.isEmpty(cropString)) {
        throw new IllegalArgumentException("Invalid crop string: '" + cropString + "'.");
      }
  
      // strip off optional size parameter after "/"
      String crop = cropString;
      if (StringUtils.contains(crop, "/")) {
        crop = StringUtils.substringBefore(crop, "/");
      }
  
      String[] parts = StringUtils.split(crop, ",");
      if (parts.length != 4) {
        throw new IllegalArgumentException("Invalid crop string: '" + cropString + "'.");
      }
      long x1 = NumberUtils.toLong(parts[0]);
      long y1 = NumberUtils.toLong(parts[1]);
      long x2 = NumberUtils.toLong(parts[2]);
      long y2 = NumberUtils.toLong(parts[3]);
      long width = x2 - x1;
      long height = y2 - y1;
      if (x1 < 0 || y1 < 0 || width <= 0 || height <= 0) {
        throw new IllegalArgumentException("Invalid crop string: '" + cropString + "'.");
      }
      return new CropDimension(x1, y1, width, height);
    }
docs: Get crop dimension from crop string.
  Please note: Crop string contains not width/height as 3rd/4th parameter but right, bottom.
  @param cropString Cropping string from CQ5 smartimage widget
  @return Crop dimension instance
  @throws IllegalArgumentException if crop string syntax is invalid