def _CalculateNewDimensions(self,
                              current_width,
                              current_height,
                              req_width,
                              req_height,
                              crop_to_fit,
                              allow_stretch):
    """Get new resize dimensions keeping the current aspect ratio.

    This uses the more restricting of the two requested values to determine
    the new ratio. See also crop_to_fit.

    Args:
      current_width: int, current width of the image.
      current_height: int, current height of the image.
      req_width: int, requested new width of the image, 0 if unspecified.
      req_height: int, requested new height of the image, 0 if unspecified.
      crop_to_fit: bool, True if the less restricting dimension should be used.
      allow_stretch: bool, True is aspect ratio should be ignored.

    Raises:
      apiproxy_errors.ApplicationError: if crop_to_fit is True either req_width
        or req_height is 0.

    Returns:
      tuple (width, height) which are both ints of the new ratio.
    """


    width_ratio = float(req_width) / current_width
    height_ratio = current_height / float(req_height)

    if allow_stretch:

      if not req_width or not req_height:
        raise apiproxy_errors.ApplicationError(
            images_service_pb.ImagesServiceError.BAD_TRANSFORM_DATA)
      return req_width, req_height
    elif crop_to_fit:

      if not req_width or not req_height:
        raise apiproxy_errors.ApplicationError(
            images_service_pb.ImagesServiceError.BAD_TRANSFORM_DATA)
      if width_ratio > height_ratio:
        return req_width, int(width_ratio * current_height)
      else:
        return int(height_ratio * current_width), req_height
    else:


      if req_width == 0 or (width_ratio > height_ratio and req_height != 0):

        return int(height_ratio * current_width), req_height
      else:

        return req_width, int(width_ratio * current_height)
dataset/ETHPy150Open AppScale/appscale/AppServer/google/appengine/api/images/images_stub.py/ImagesServiceStub._CalculateNewDimensions/swapped operands of `/`