Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
Commitd98fb0bf931735c3df9107b0fe2ebb73c0d3276d (patch)
Author
 Syndamia <kamen@syndamia.com>
2024-05-19 19:51:27 +0300
Committer
 Syndamia <kamen@syndamia.com>
2024-05-19 19:51:27 +0300
Files85cfc7a29253ed5bde648c6f8dad9c8e8deac117
uni-projects-d98fb0bf931735c3df9107b0fe2ebb73c0d3276d.tar
uni-projects-d98fb0bf931735c3df9107b0fe2ebb73c0d3276d.tar.gz
uni-projects-d98fb0bf931735c3df9107b0fe2ebb73c0d3276d.zip
Parent7f9cf22d0d3e84145898a3ed63e09a0ad1b0a5da (diff)
[iot/goam] Updated Content-Type of image and increased resolution
2 files changed, 3 insertions, 2 deletions
-rw-r--r--Year 3/Internet of things/goam/main/main.c2
-rw-r--r--Year 3/Internet of things/goam/main/webserver.c3
diff --git a/Year 3/Internet of things/goam/main/main.c b/Year 3/Internet of things/goam/main/main.c
index d3d3ee6..3af6dd3 100644
--- a/Year 3/Internet of things/goam/main/main.c
+++ b/Year 3/Internet of things/goam/main/main.c
@@ -51,7 +51,7 @@ void print_chip_data() {
#define BTN_SHOOT_PIN 13
void take_photo() {
- ptc06_set_image_resolution(RES_160X120);
+ ptc06_set_image_resolution(RES_640X480);
char* image;
size_t length = ptc06_get_image(&image);
spiffs_write("/spiffs/capture.jpeg", image, length);
diff --git a/Year 3/Internet of things/goam/main/webserver.c b/Year 3/Internet of things/goam/main/webserver.c
index 9baa5ec..f803315 100644
--- a/Year 3/Internet of things/goam/main/webserver.c
+++ b/Year 3/Internet of things/goam/main/webserver.c
@@ -67,8 +67,9 @@ static bool request_get_query(httpd_req_t *req, const char* query_name, char* bu
static esp_err_t get_handler(httpd_req_t *req)
{
/* Set some custom headers */
- /* httpd_resp_set_hdr(req, "Custom-Header-1", "Custom-Value-1"); */
+ /* httpd_resp_set_hdr(req, "Content-Type", "image/jpeg"); */
+ ESP_ERROR_CHECK(httpd_resp_set_type(req, "image/jpeg"));
/* Send response with custom headers and body set as the
* string passed in user context*/
/* const char resp_str[] = "<html><head><title>Hello</title></head><body>World</body></html>"; */