• SvenBBB

    Hi All!

    First post here, so be easy on me ;)

    I searched the forum for an answer for my question but found none. If the answer is here, my inexperience with the forum could be the reason for not finding it.

    The question:

    I have script for shooting photo’s using objc_util. I copy pasted the heck out of a script but this script makes jpeg files (Thank you for writing this already amazing piece of code!). So compressed. If I want to shoot RAW, what should I do?

    This is the photo shooting part of the script:

    def take_photo_now(filename = fileName):
        session = C('AVCaptureSession').new().autorelease()
        session.sessionPreset = 'AVCaptureSessionPresetPhoto'
        device = C('AVCaptureDevice').defaultDeviceWithMediaType_('vide')
        device_input = C('AVCaptureDeviceInput').deviceInputWithDevice_error_(device, None)
        image_output = C('AVCaptureStillImageOutput').new().autorelease()
        # NOTE: You may need to adjust this to wait for the camera to be ready (use a higher number if you see black photos):
        def handler_func(_block, _buffer, _err):
            buffer = ObjCInstance(_buffer)
            img_data = C('AVCaptureStillImageOutput').jpegStillImageNSDataRepresentation_(buffer)
            img_data.writeToFile_atomically_(filename, True)
        video_connection = None
        for connection in image_output.connections():
            for port in connection.inputPorts():
                if str(port.mediaType()) == 'vide':
                    video_connection = connection
            if video_connection:
        e = threading.Event()
        handler = ObjCBlock(handler_func, restype=None, argtypes=[c_void_p, c_void_p, c_void_p])
        image_output.captureStillImageAsynchronouslyFromConnection_completionHandler_(video_connection, handler)

    Thank you in advance!!!

    posted in Pythonista read more

Internal error.

Oops! Looks like something went wrong!