~martijnbraam/public-inbox

Megapixels: Implementing fallbacks when special dirs don't behave as expected #44 v1 PROPOSED

Maarten van Gompel: 1
 Implementing fallbacks when special dirs don't behave as expected #44

 1 files changed, 17 insertions(+), 4 deletions(-)
#436594 alpine.yml success
#436595 arch.yml success
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~martijnbraam/public-inbox/patches/20480/mbox | git am -3
Learn more about email & git
View this thread in the archives

[PATCH Megapixels] Implementing fallbacks when special dirs don't behave as expected #44 Export this patch

This solves https://todo.sr.ht/~martijnbraam/Megapixels/44 , seems need
in sxmo (at least for me).

---
 process_pipeline.c | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)

diff --git a/process_pipeline.c b/process_pipeline.c
index 4ba2f99..017089d 100644
--- a/process_pipeline.c
+++ b/process_pipeline.c
@@ -357,10 +357,23 @@ process_capture_burst(cairo_surface_t *thumb)
	char timestamp[30];
	strftime(timestamp, 30, "%Y%m%d%H%M%S", &tim);

	sprintf(capture_fname,
		"%s/IMG%s",
		g_get_user_special_dir(G_USER_DIRECTORY_PICTURES),
		timestamp);
	if (g_get_user_special_dir(G_USER_DIRECTORY_PICTURES) != NULL) {
		sprintf(capture_fname,
			"%s/IMG%s",
			g_get_user_special_dir(G_USER_DIRECTORY_PICTURES),
			timestamp);
	} else if (getenv("XDG_PICTURES_DIR") != NULL) {
		sprintf(capture_fname,
			"%s/IMG%s",
			getenv("XDG_PICTURES_DIR"),
			timestamp);
	} else {
		sprintf(capture_fname,
			"%s/Pictures/IMG%s",
			getenv("HOME"),
			timestamp);
	}


	// Start post-processing the captured burst
	g_print("Post process %s to %s.ext\n", burst_dir, capture_fname);
--
2.30.1
builds.sr.ht
megapixels/patches: SUCCESS in 1m22s

[Implementing fallbacks when special dirs don't behave as expected #44][0] from [Maarten van Gompel][1]

[0]: https://lists.sr.ht/~martijnbraam/public-inbox/patches/20480
[1]: mailto:proycon@anaproy.nl

✓ #436594 SUCCESS megapixels/patches/alpine.yml https://builds.sr.ht/~martijnbraam/job/436594
✓ #436595 SUCCESS megapixels/patches/arch.yml   https://builds.sr.ht/~martijnbraam/job/436595