From: Gary L. <li...@lu...> - 2004-10-03 20:23:48
|
I've solved the DLL question with the following: c:\DevCpp\bin\gcc -shared -o libexif.dll ../libexif/exif-byte-order.o ../libexif/exif-content.o ../libexif/exif-data.o ../libexif/exif-entry.o ../libexif/exif-format.o ../libexif/exif-ifd.o ../libexif/exif-loader.o ../libexif/exif-log.o ../libexif/exif-mnote-data.o ../libexif/exif-tag.o ../libexif/exif-utils.o ../libexif/canon/exif-mnote-data-canon.o ../libexif/canon/mnote-canon-entry.o ../libexif/canon/mnote-canon-tag.o ../libexif/olympus/exif-mnote-data-olympus.o ../libexif/olympus/mnote-olympus-entry.o ../libexif/olympus/mnote-olympus-tag.o ../libexif/pentax/exif-mnote-data-pentax.o ../libexif/pentax/mnote-pentax-entry.o ../libexif/pentax/mnote-pentax-tag.o -W1 --out-implib,libexif.a c:\DevCpp\bin\impdef.exe libexif.dll > libexif.def c:\DevCpp\bin\dlltool --dllname libexif.dll --def libexif.def --output-lib libexif.a so now I've just got to get to grips with the library. Any ideas where to start? Thanks Gary Gary Lawton http://www.garylawton.com Gary Lawton wrote: > 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 >> >> >> > > > ------------------------------------------------------- > This SF.net email is sponsored by: IT Product Guide on ITManagersJournal > Use IT products in your business? Tell us what you think of them. Give us > Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out > more > http://productguide.itmanagersjournal.com/guidepromo.tmpl > _______________________________________________ > Libexif-devel mailing list > Lib...@li... > https://lists.sourceforge.net/lists/listinfo/libexif-devel |