public static @Nullable Dimension getSize(@NotNull Element element, @NotNull String width, @NotNull String height) {
    String sWidth = element.getAttributeValue(width);
    if (sWidth == null) return null;
    String sHeight = element.getAttributeValue(height);
    if (sHeight == null) return null;
    try {
      int iWidth = Integer.parseInt(sWidth);
      if (iWidth <= 0) return null;
      int iHeight = Integer.parseInt(sHeight);
      if (iHeight <= 0) return null;
      return new Dimension(iWidth, iHeight);
    }
    catch (NumberFormatException ignored) {
      return null;
    }
  }
public static @Nullable Dimension getSize(@NotNull Element element, @NotNull String width, @NotNull String height)