Enlightenment CVS committal
Author : titan
Project : e17
Module : proto
Dir : e17/proto/ephoto/src/bin
Modified Files:
ephoto.c
Log Message:
Easier way to populate some images in a album for now.
===================================================================
RCS file: /cvs/e/e17/proto/ephoto/src/bin/ephoto.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -3 -r1.10 -r1.11
--- ephoto.c 29 Jan 2007 09:51:24 -0000 1.10
+++ ephoto.c 30 Jan 2007 10:21:13 -0000 1.11
@@ -28,6 +28,9 @@
" arg1 = name of
album to add image to\n"
" arg2 =
descriptive name for image\n"
" arg3 = path to
the image\n"
+ " --add-image-dir %%s %%s - Adds
All Images From Directory\n"
+ " arg1 = name of
album to add images to\n"
+ " arg2 =
directory to get images from\n"
" --list-albums - List Albums\n"
" --list-images %%s - List Images in
Album\n"
" arg1 = name of
album to list images from\n"
@@ -40,6 +43,7 @@
" -h - This Screen\n"
" -a %%s %%s - Adds Album\n"
" -i %%s %%s %%s - Adds Image\n"
+ " -id %%s %%s - Adds all Images
From Directory\n"
" -la - List Albums\n"
" -li %%s - List
Images in Album\n"
" -ra %%s - Removes
Album\n"
@@ -118,6 +122,46 @@
}
else printf("Image was not added\n");
+ return 0;
+ }
+ if(!strcmp(argv[i], "--add-image-dir") || !strcmp(argv[i],
"-id"))
+ {
+ i++;
+ if(argv[i]) album = argv[i];
+ else
+ {
+ printf("Please specify the album you wish to
add to\n");
+ return 1;
+ }
+
+ i++;
+ if(argv[i]) path = argv[i];
+ else
+ {
+ printf("Please specify the path to the image
directory\n");
+ return 1;
+ }
+
+ printf("Are you sure you want to add images "
+ "from the directory %s to the album %s? ",
+ path, album);
+ scanf("%c", &input);
+ if(!strncasecmp(input, "y", 1))
+ {
+ db = ephoto_db_init();
+ images = ecore_list_new();
+ images = get_images(path);
+ while (!ecore_list_is_empty(images))
+ {
+ name = ecore_list_remove_first(images);
+ ephoto_db_add_image(db, album,
basename(name), name);
+ }
+ ephoto_db_close(db);
+ ecore_list_destroy(images);
+ printf("Images were added\n");
+ }
+ else printf("Images were not added\n");
+
return 0;
}
if(!strcmp(argv[i], "--list-albums") || !strcmp(argv[i], "-la"))
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs