code: public static boolean isInlineModeAllowed(Element img, InlineMode mode) {
  		// if already inlined => reject (do not inline twice)
  		if (!img.attr(INLINED_ATTR).isEmpty()) {
  			return false;
  		}
  		// if inline mode defined but not the wanted mode => reject
  		if (!img.attr(INLINE_MODE_ATTR).isEmpty() && !img.attr(INLINE_MODE_ATTR).equals(mode.mode())) {
  			return false;
  		}
  		// if inline mode defined and matches the wanted mode => allow
  		// if no inline mode defined => allow (any mode allowed)
  		return true;
  	}
docs: Checks if inlining mode is allowed on the provided element.
  
  @param img
  the image element to check if the actual inlining mode is
  allowed
  @param mode
  the actual mode
  @return true if this mode is allowed, false otherwise