code: def get_image_dimensions(request):
          
          if request.service_type is ServiceType.WCS or (isinstance(request.size_x, int) and
                                                         isinstance(request.size_y, int)):
              return request.size_x, request.size_y
          if not isinstance(request.size_x, int) and not isinstance(request.size_y, int):
              raise ValueError("At least one of parameters 'width' and 'height' must have an integer value")
          missing_dimension = get_image_dimension(request.bbox, width=request.size_x, height=request.size_y)
          if request.size_x is None:
              return missing_dimension, request.size_y
          if request.size_y is None:
              return request.size_x, missing_dimension
          raise ValueError("Parameters 'width' and 'height' must be integers or None")
docs: Verifies or calculates image dimensions.
  
          :param request: OGC-type request
          :type request: WmsRequest or WcsRequest
          :return: horizontal and vertical dimensions of requested image
          :rtype: (int or str, int or str)