From 8fe634c1e1270888e50f261759aeb01c9dd04cfb Mon Sep 17 00:00:00 2001 From: Martijn Braam Date: Thu, 3 Sep 2020 17:34:46 +0200 Subject: [PATCH] Fixed filenames --- main.c | 6 +++++- pinephone.ini | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/main.c b/main.c index 7584d63..248af2c 100644 --- a/main.c +++ b/main.c @@ -344,9 +344,11 @@ process_image(const int *p, int size) { clock_t t; time_t rawtime; + struct tm tim; uint8_t *pixels; double time_taken; char fname[255]; + char timestamp[30]; GdkPixbuf *pixbuf; GdkPixbuf *pixbufrot; GError *error = NULL; @@ -378,7 +380,9 @@ process_image(const int *p, int size) } if (capture){ time(&rawtime); - sprintf(fname, "%s/Pictures/Photo-%s.jpg", getenv("HOME"), ctime(&rawtime)); + tim =*(localtime(&rawtime)); + strftime(timestamp, 30, "%F %T", &tim); + sprintf(fname, "%s/Pictures/Photo-%s.jpg", getenv("HOME"), timestamp); printf("Saving image\n"); gdk_pixbuf_save(pixbufrot, fname, "jpeg", &error, "quality", "85", NULL); if(error != NULL) { diff --git a/pinephone.ini b/pinephone.ini index 355abb4..9c61d73 100644 --- a/pinephone.ini +++ b/pinephone.ini @@ -3,8 +3,8 @@ csi=sun6i-csi [rear] driver=ov5640 -width=1280 -height=720 +width=1920 +height=1080 fmt=BGGR8 rotate=270