$split_size = explode('-', $size); $width = $split_size[0]; $height = $split_size[1]; $settings_file = str_replace('ajax/' . basename(__FILE__), 'data/settings.json', __FILE__); $settings = array(); $settings['encoding'] = $encoding; $settings['iso'] = $iso; $settings['width'] = $width; $settings['height'] = $height; $settings['quality'] = $quality; $settings['imxfx'] = $imxfx; $settings['brightness'] = $brightness; $settings['contrast'] = $contrast; $settings['sharpness'] = $sharpness; $settings['saturation'] = $saturation; $settings['awb'] = $awb; $settings['ev'] = $ev_comp; $settings['exposure'] = $exposure; $settings['rotation'] = $rotation; $settings['metering'] = $metering; $settings['flip'] = $flip; $settings['name'] = 'picture'; $json = json_encode($settings); write_file($settings_file, $json, 'w'); $camera = new Camera($settings); $camera->output->setValue(TEMP_PATH . 'picture.' . $settings['encoding']); $camera->{$flip}->setValue(' '); $camera->doImage(); $_response_items['command'] = $camera->get_command(); header('Content-Type: application/json'); echo json_encode($_response_items);