code: public static @Nullable Dimension getDimension(@NotNull Rendition rendition,
        boolean suppressLogWarningNoRenditionsMetadata) {
  
      String fileExtension = FilenameUtils.getExtension(getFilename(rendition));
      if (!FileExtension.isImage(fileExtension)) {
        // this is not a supported image file extension - skip further processing
        return null;
      }
  
      // get image width/height
      Dimension dimension = null;
      boolean isOriginal = isOriginal(rendition);
      if (isOriginal) {
        // get width/height from metadata for original renditions
        dimension = getDimensionFromOriginal(rendition);
      }
      else {
        // otherwise get from rendition metadata written by {@link DamRenditionMetadataService}
        dimension = getDimensionFromRenditionMetadata(rendition);
      }
  
      // fallback: if width/height could not be read from either asset or rendition metadata load the image
      // into memory and get width/height from there - but log an warning because this is inefficient
      if (dimension == null) {
        dimension = getDimensionFromImageBinary(rendition, suppressLogWarningNoRenditionsMetadata);
      }
  
      return dimension;
    }
docs: Get dimension (width, height) of given DAM rendition.
  <p>
  It reads the dimension information from the
  asset metadata for the original rendition, or from the rendition metadata generated by the
  "DamRenditionMetadataService". If both is not available it gets the dimension from the renditions
  binary file, but this is inefficient and should not happen under sound conditions.
  </p>
  @param rendition Rendition
  @param suppressLogWarningNoRenditionsMetadata If set to true, no log warnings is generated when
  renditions metadata containing the with/height of the rendition does not exist (yet).
  @return Dimension or null if dimension could not be detected, not even in fallback mode