2002-02-02 Lutz M�ller <lutz@users.sourceforge.net>

* frontends/command-line: Let --show-exif accept image numbers, too.


git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@4067 67ed7778-7388-44ab-90cf-0a291f65f57c
This commit is contained in:
Lutz Mueller
2002-02-03 08:20:46 +00:00
parent c067af31c8
commit 7367b7fdd2
4 changed files with 16 additions and 5 deletions

View File

@@ -1,3 +1,7 @@
2002-02-02 Lutz Müller <lutz@users.sourceforge.net>
* frontends/command-line: Let --show-exif accept image numbers, too.
2002-02-01 Lutz Müller <lutz@users.sourceforge.net>
* frontends/command-line/gphoto2-cmd-exif.[c,h]: New

View File

@@ -200,7 +200,7 @@ get_path_for_id_rec (const char *base_folder, unsigned int id,
}
}
static int
int
get_path_for_id (const char *base_folder, unsigned char recurse,
unsigned int id, const char **folder, const char **filename)
{

View File

@@ -30,4 +30,8 @@ int for_each_image (const char *folder, image_action iaction,
int for_each_image_in_range (const char *folder, unsigned char recurse,
char *range, image_action action, int reverse);
int get_path_for_id (const char *base_folder, unsigned char recurse,
unsigned int id, const char **folder,
const char **filename);
#endif /* __FOREACH_H__ */

View File

@@ -20,10 +20,14 @@
#include <config.h>
#include "gphoto2-cmd-exif.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <libexif/exif-data.h>
#include "foreach.h"
#ifdef ENABLE_NLS
# include <libintl.h>
# undef _
@@ -84,10 +88,9 @@ gp_cmd_exif (Camera *camera, const char *folder, const char *filename,
ExifData *ed;
/* Did the user specify a number? */
if (!strchr (filename, '.')) {
gp_context_error (context, _("Please specify a filename."));
return (GP_ERROR);
}
if (!strchr (filename, '.'))
CR (get_path_for_id (folder, 1, atoi (filename) - 1, &folder,
&filename));
CR (gp_file_new (&file));
CRU (gp_camera_file_get (camera, folder, filename, GP_FILE_TYPE_EXIF,