def _set_resolution(self, value):
    self._check_camera_open()
    self._check_recording_stopped()
    value = mo.to_resolution(value)
    if (not ((0 < value.width <= self.MAX_RESOLUTION.width) and (0 < value.height <= self.MAX_RESOLUTION.height))):
        raise PiCameraValueError(('Invalid resolution requested: %r' % (value,)))
    sensor_mode = self.sensor_mode
    clock_mode = self.CLOCK_MODES[self.clock_mode]
    framerate = Fraction(self.framerate)
    if (framerate == 0):
        framerate = self.framerate_range
    self._disable_camera()
    self._configure_camera(sensor_mode=sensor_mode, framerate=framerate, resolution=value, clock_mode=clock_mode)
    self._configure_splitter()
    self._enable_camera()
def _set_resolution(self, value):
    self._check_camera_open()
    self._check_recording_stopped()
    value = mo.to_resolution(value)
    if (not ((0 < value.width <= self.MAX_RESOLUTION.width) and (0 < value.height <= self.MAX_RESOLUTION.height))):
        raise PiCameraValueError(('Invalid resolution requested: %r' % (value,)))
    sensor_mode = self.sensor_mode
    clock_mode = self.CLOCK_MODES[self.clock_mode]
    framerate = Fraction(self.framerate)
    if (framerate == 0):
        framerate = self.framerate_range
    self._disable_camera()
    self._configure_camera(sensor_mode=sensor_mode, framerate=framerate, resolution=value, clock_mode=clock_mode)
    self._configure_splitter()
    self._enable_camera()