code: public static boolean canSetCustomIPECropRatios(@NotNull MediaRequest mediaRequest,
        @Nullable ComponentContext wcmComponentContext) {
  
      EditConfig editConfig = null;
      InplaceEditingConfig ipeConfig = null;
      if (wcmComponentContext != null && wcmComponentContext.getEditContext() != null
          && wcmComponentContext.getEditContext().getEditConfig() != null
          && wcmComponentContext.getResource() != null) {
        editConfig = wcmComponentContext.getEditContext().getEditConfig();
        ipeConfig = editConfig.getInplaceEditingConfig();
      }
      if (editConfig == null || ipeConfig == null
          || !StringUtils.equals(ipeConfig.getEditorType(), "image")) {
        // no image IPE activated - never customize crop ratios
        return false;
      }
  
      switch (mediaRequest.getMediaArgs().getIPERatioCustomize()) {
        case ALWAYS:
          return true;
        case NEVER:
          return false;
        case AUTO:
          if (StringUtils.isNotEmpty(ipeConfig.getConfigPath())) {
            String ratiosPath = ipeConfig.getConfigPath() + "/plugins/crop/aspectRatios";
            @SuppressWarnings("null")
            ResourceResolver resolver = wcmComponentContext.getResource().getResourceResolver();
            return resolver.getResource(ratiosPath) == null;
          }
          return true;
        default:
          throw new IllegalArgumentException("Unsupported IPE ratio customize mode: "
              + mediaRequest.getMediaArgs().getIPERatioCustomize());
      }
  
    }
docs: Implements check whether to set customized IPE cropping ratios as described in {@link IPERatioCustomize}.
  @param mediaRequest Media request
  @param wcmComponentContext WCM component context
  @return true if customized IP cropping ratios can be set