Fixed filenames
This commit is contained in:
parent
1503b71430
commit
8fe634c1e1
6
main.c
6
main.c
|
@ -344,9 +344,11 @@ process_image(const int *p, int size)
|
||||||
{
|
{
|
||||||
clock_t t;
|
clock_t t;
|
||||||
time_t rawtime;
|
time_t rawtime;
|
||||||
|
struct tm tim;
|
||||||
uint8_t *pixels;
|
uint8_t *pixels;
|
||||||
double time_taken;
|
double time_taken;
|
||||||
char fname[255];
|
char fname[255];
|
||||||
|
char timestamp[30];
|
||||||
GdkPixbuf *pixbuf;
|
GdkPixbuf *pixbuf;
|
||||||
GdkPixbuf *pixbufrot;
|
GdkPixbuf *pixbufrot;
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
@ -378,7 +380,9 @@ process_image(const int *p, int size)
|
||||||
}
|
}
|
||||||
if (capture){
|
if (capture){
|
||||||
time(&rawtime);
|
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");
|
printf("Saving image\n");
|
||||||
gdk_pixbuf_save(pixbufrot, fname, "jpeg", &error, "quality", "85", NULL);
|
gdk_pixbuf_save(pixbufrot, fname, "jpeg", &error, "quality", "85", NULL);
|
||||||
if(error != NULL) {
|
if(error != NULL) {
|
||||||
|
|
|
@ -3,8 +3,8 @@ csi=sun6i-csi
|
||||||
|
|
||||||
[rear]
|
[rear]
|
||||||
driver=ov5640
|
driver=ov5640
|
||||||
width=1280
|
width=1920
|
||||||
height=720
|
height=1080
|
||||||
fmt=BGGR8
|
fmt=BGGR8
|
||||||
rotate=270
|
rotate=270
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue