From: Gary L. <li...@lu...> - 2004-10-03 19:10:46
|
Thanks, I've managed to get a library and test program as follows to compile. Two questions: 1. I can see which tags exist in my test image, but how do I get at their values 2. Is it straight-foward to build a DLL for this or am I better sticking with the library? If so how do I go about this? (cc'd to the list as reference for others) Gary #include <stdio.h> #include <stdlib.h> #include <windows.h> #include <libexif/exif-data.h> #include <libexif/exif-loader.h> #include <libexif/exif-log.h> #include <libexif/exif-ifd.h> #define ENTRY_FOUND " * " #define ENTRY_NOT_FOUND " - " void action_tag_table (const char *filename, ExifData *ed) { unsigned int tag; const char *name; char txt[1024]; unsigned int i; memset (txt, 0, sizeof (txt)); sprintf (txt, "EXIF tags in '%s':", filename); fprintf (stdout, "%-38.38s", txt); for (i = 0; i < EXIF_IFD_COUNT; i++) fprintf (stdout, "%-7.7s", exif_ifd_get_name (i)); fputc ('\n', stdout); for (tag = 0; tag < 0xffff; tag++) { name = exif_tag_get_title (tag); if (!name) continue; fprintf (stdout, " 0x%04x %-29.29s", tag, name); for (i = 0; i < EXIF_IFD_COUNT; i++) if (exif_content_get_entry (ed->ifd[i], tag)) printf (ENTRY_FOUND); else printf (ENTRY_NOT_FOUND); fputc ('\n', stdout); } } int main(int argc, char *argv[]) { ExifLoader *l; ExifData *ed; char fname[] = "c:\\temp\\test.jpg"; l = exif_loader_new (); exif_loader_write_file (l, fname); ed = exif_loader_get_data (l); exif_loader_unref (l); action_tag_table (fname, ed); system("PAUSE"); return 0; } Gary Lawton http://www.garylawton.com Antonio Scuri wrote: > > I'm sending two files. I do not remember if the second one is > distributed with the sources or not. > > The makefile is quite simple, using Dev-C++ just create an empty > project and add all the sources. I do not have a simple one because I > merged some libs together to build my own lib: > > http://www.tecgraf.puc-rio.br/im > > Best, > scuri > > At 05:23 10/03/04, you wrote: > >> Do you also have a suitable makefile (or how can I generate this) >> >> Thanks >> Gary >> >> Gary Lawton >> http://www.garylawton.com >> >> >> >> Antonio Scuri wrote: >> >>> >>> Hi, >>> >>> I compile libexif in several platforms (including mingw) just >>> writing a proper "config.h" file. If you want I can send it to you. >>> >>> scuri >> >------------------------------------------------------------------------ > > >#ifndef __STDINT_H >#define __STDINT_H > >#ifndef __int8_t_defined >#define __int8_t_defined >typedef signed char int8_t; >typedef short int16_t; >typedef long int32_t; >#endif > >typedef unsigned char uint8_t; >typedef unsigned short uint16_t; >#ifndef __uint32_t_defined >#define __uint32_t_defined >typedef unsigned long uint32_t; >#endif > >#endif > > >------------------------------------------------------------------------ > > >/* Define to 1 if translation of program messages to the user's native > language is requested. */ >/* #undef ENABLE_NLS */ > >/* The gettext domain we're using */ >#define GETTEXT_PACKAGE "libexif-9" > >#ifdef WIN32 >#define snprintf _snprintf >#endif > > > |