Enlightenment CVS committal

Author  : atmosphere
Project : e17
Module  : libs/epsilon

Dir     : e17/libs/epsilon/src/lib


Modified Files:
        Makefile.am Epsilon.c Epsilon.h 


Log Message:
updates to use new exif code
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/epsilon/src/lib/Makefile.am,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- Makefile.am 12 May 2004 18:21:26 -0000      1.2
+++ Makefile.am 9 Oct 2004 18:55:23 -0000       1.3
@@ -4,6 +4,7 @@
 
 # A list of all the files in the current directory which can be regenerated
 MAINTAINERCLEANFILES = Makefile.in
+SUBDIRS = exiftags
 
 LDFLAGS                     = -L/usr/local/lib @imlib_libs@ @epeg_libs@
 INCLUDES            = -I/usr/local/include \
@@ -13,8 +14,23 @@
 include_HEADERS      = Epsilon.h
 libepsilon_la_SOURCES  = \
 Epsilon.c \
-md5.c md5.h
+Epsilon_Exif.c \
+md5.c md5.h \
+exiftags/canon.c \
+exiftags/casio.c \
+exiftags/exif.c \
+exiftags/exifutil.c \
+exiftags/fuji.c \
+exiftags/getopt.c \
+exiftags/jpeg.c \
+exiftags/makers.c \
+exiftags/minolta.c \
+exiftags/nikon.c \
+exiftags/olympus.c \
+exiftags/tagdefs.c
 
-libepsilon_la_LIBADD       = $(LDFLAGS)
-libepsilon_la_DEPENDENCIES = ../config.h
+libepsilon_la_LIBADD   = $(LDFLAGS)
+libepsilon_la_DEPENDENCIES = ../config.h 
 libepsilon_la_LDFLAGS      = -version-info 0:1:0
+
+EXTRA_DIST= exiftags
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/epsilon/src/lib/Epsilon.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- Epsilon.c   3 Feb 2004 19:19:51 -0000       1.6
+++ Epsilon.c   9 Oct 2004 18:55:23 -0000       1.7
@@ -18,106 +18,127 @@
 #include <Epeg.h>
 #endif
 #define THUMBNAIL_SIZE 256
+#include "exiftags/exif.h"
 
-static char* epsilon_hash(const char *file);
-static int _epsilon_png_mtime_get(const char *file);
+extern void epsilon_exif_info_free (Epsilon_Exif_Info * eei);
+/*
+ * epsilon_exif_info_get
+ * NULL on no exif data present
+ * Returns a valid pointer to an Epsilon_Exif_Info object 
+ */
+extern Epsilon_Exif_Info *epsilon_exif_info_get (Epsilon * e);
+
+static char *epsilon_hash (const char *file);
+static int _epsilon_png_mtime_get (const char *file);
 #ifdef HAVE_EPEG_H
-static int _epsilon_jpg_mtime_get(const char *file);
+static int _epsilon_jpg_mtime_get (const char *file);
 #endif
-static FILE * _epsilon_open_png_file_reading (const char *filename);
-static int _epsilon_png_write(const char *file, DATA32 * ptr, 
-int tw, int th, int sw, int sh, char *imformat, int mtime, char *uri);
+static FILE *_epsilon_open_png_file_reading (const char *filename);
+static int _epsilon_png_write (const char *file, DATA32 * ptr,
+                              int tw, int th, int sw, int sh, char *imformat,
+                              int mtime, char *uri);
 
-Epsilon*
-epsilon_new(const char *file)
+Epsilon *
+epsilon_new (const char *file)
 {
-    Epsilon *result = NULL;
-    if(file)
+  Epsilon *result = NULL;
+  if (file)
     {
-       if(file[0] == '/')
+      if (file[0] == '/')
        {
-           result = malloc(sizeof(Epsilon));
-           memset(result, 0, sizeof(Epsilon));
-           result->src = strdup(file);
-           result->hash = epsilon_hash(result->src);
+         result = malloc (sizeof (Epsilon));
+         memset (result, 0, sizeof (Epsilon));
+         result->src = strdup (file);
+         result->hash = epsilon_hash (result->src);
        }
-       else
+      else
        {
-           fprintf(stderr, "Invalid filename given: %s\n", file);
-           fprintf(stderr, "Epsilon expects the full path to file\n");
+         fprintf (stderr, "Invalid filename given: %s\n", file);
+         fprintf (stderr, "Epsilon expects the full path to file\n");
        }
     }
-    return(result);
+  return (result);
 }
+
 void
-epsilon_free(Epsilon *e)
+epsilon_free (Epsilon * e)
 {
-    if(e)
+  if (e)
     {
-       if(e->hash) free(e->hash);
-       if(e->src) free(e->src);
-       free(e);
+      if (e->hash)
+       free (e->hash);
+      if (e->src)
+       free (e->src);
+      free (e);
     }
 }
 void
-epsilon_init(void)
+epsilon_init (void)
 {
-    int i = 0;
-    struct stat status;
-    char buf[PATH_MAX];
-    char *dirs[] = { ".thumbnails", ".thumbnails/normal", 
-                   ".thumbnails/large", ".thumbnails/fail" };
-    
-    for(i = 0; i < 4; i++)
-    {
-       snprintf(buf, PATH_MAX, "%s/%s", getenv("HOME"), dirs[i]);
-       if(!stat(buf, &status)) continue;
-       else mkdir(buf, S_IRUSR | S_IWUSR | S_IXUSR);
+  int i = 0;
+  struct stat status;
+  char buf[PATH_MAX];
+  char *dirs[] = { ".thumbnails", ".thumbnails/normal",
+    ".thumbnails/large", ".thumbnails/fail"
+  };
+
+  for (i = 0; i < 4; i++)
+    {
+      snprintf (buf, PATH_MAX, "%s/%s", getenv ("HOME"), dirs[i]);
+      if (!stat (buf, &status))
+       continue;
+      else
+       mkdir (buf, S_IRUSR | S_IWUSR | S_IXUSR);
     }
 }
 
-const char*
-epsilon_file_get(Epsilon *e)
-{
-    char *result = NULL;
-    if(e) result = e->src;
-    return(result);
-}
-const char*
-epsilon_thumb_file_get(Epsilon *e)
-{
-    int i = 0;
-    struct stat status;
-    char buf[PATH_MAX];
-    char *dirs[] = { ".thumbnails/normal", ".thumbnails/large",
-                    ".thumbnails/fail" };
-   
-    if(!e) return(NULL);
-    if(e->thumb) return(e->thumb);
-    for(i = 0; i < 3; i++)
+const char *
+epsilon_file_get (Epsilon * e)
+{
+  char *result = NULL;
+  if (e)
+    result = e->src;
+  return (result);
+}
+const char *
+epsilon_thumb_file_get (Epsilon * e)
+{
+  int i = 0;
+  struct stat status;
+  char buf[PATH_MAX];
+  char *dirs[] = { ".thumbnails/normal", ".thumbnails/large",
+    ".thumbnails/fail"
+  };
+
+  if (!e)
+    return (NULL);
+  if (e->thumb)
+    return (e->thumb);
+  for (i = 0; i < 3; i++)
     {
 #ifdef HAVE_EPEG_H
-       snprintf(buf, PATH_MAX, "%s/%s/%s.jpg", getenv("HOME"), dirs[i],
-       e->hash);
-       if(stat(buf, &status) == 0) 
+      snprintf (buf, PATH_MAX, "%s/%s/%s.jpg", getenv ("HOME"), dirs[i],
+               e->hash);
+      if (stat (buf, &status) == 0)
        {
-           e->thumb = strdup(buf);
-           break;
+         e->thumb = strdup (buf);
+         break;
        }
 #endif
-       snprintf(buf, PATH_MAX, "%s/%s/%s.png", getenv("HOME"), dirs[i],
-       e->hash);
-       if(stat(buf, &status) == 0) 
+      snprintf (buf, PATH_MAX, "%s/%s/%s.png", getenv ("HOME"), dirs[i],
+               e->hash);
+      if (stat (buf, &status) == 0)
        {
-           if(e->thumb) free(e->thumb);
-           e->thumb = strdup(buf);
-           break;
+         if (e->thumb)
+           free (e->thumb);
+         e->thumb = strdup (buf);
+         break;
        }
     }
-    return(e->thumb);
+  return (e->thumb);
 }
-static char*
-epsilon_hash(const char *file)
+static char *
+epsilon_hash (const char *file)
 {
   int n;
   MD5_CTX ctx;
@@ -129,7 +150,7 @@
 
   if (!file)
     return (NULL);
-  snprintf(uri, PATH_MAX, "file://%s", file);
+  snprintf (uri, PATH_MAX, "file://%s", file);
 
   MD5Init (&ctx);
   MD5Update (&ctx, uri, strlen (uri));
@@ -141,61 +162,65 @@
       md5out[2 * n + 1] = hex[hash[n] & 0x0f];
     }
   md5out[2 * n] = '\0';
-  return(strdup(md5out));
+  return (strdup (md5out));
 }
-static Epsilon_Info*
-epsilon_info_new(void)
+static Epsilon_Info *
+epsilon_info_new (void)
 {
-    Epsilon_Info *result = NULL;
-    result = malloc(sizeof(Epsilon_Info));
-    memset(result, 0, sizeof(Epsilon_Info));
-    return(result);
+  Epsilon_Info *result = NULL;
+  result = malloc (sizeof (Epsilon_Info));
+  memset (result, 0, sizeof (Epsilon_Info));
+  return (result);
 }
+
 void
-epsilon_info_free(Epsilon_Info *info)
+epsilon_info_free (Epsilon_Info * info)
 {
-    if(info)
+  if (info)
     {
-       if(info->uri) free(info->uri);
-       if(info->mimetype) free(info->mimetype);
-       free(info);
+      if (info->uri)
+       free (info->uri);
+      if (info->mimetype)
+       free (info->mimetype);
+      if (info->eei)
+       epsilon_exif_info_free (info->eei);
+      free (info);
     }
 }
-Epsilon_Info*
-epsilon_info_get(Epsilon *e)
+Epsilon_Info *
+epsilon_info_get (Epsilon * e)
 {
   FILE *fp = NULL;
   Epsilon_Info *p = NULL;
 #ifdef HAVE_EPEG_H
-    Epeg_Image *im;
-    Epeg_Thumbnail_Info info;
-    int len = 0;
+  Epeg_Image *im;
+  Epeg_Thumbnail_Info info;
+  int len = 0;
 #endif
-  
-  if(!e || !epsilon_thumb_file_get(e)) return(p);
+
+  if (!e || !epsilon_thumb_file_get (e))
+    return (p);
 #ifdef HAVE_EPEG_H
-    len = strlen(e->thumb);
-    if((len > 4) && 
-       (
-       !strcmp(&e->thumb[len-3], "jpg") ||
-       !strcmp(&e->thumb[len-3], "JPG")
-       ) &&
-       (im = epeg_file_open(e->thumb)))
-    {
-       epeg_thumbnail_comments_get(im, &info);
-       if(info.mimetype)
-       {
-           p = epsilon_info_new();
-           p->mtime = info.mtime;
-           p->w = info.w;
-           p->h = info.h;
-           if(info.uri)
-               p->uri = strdup(info.uri);
-           if(info.mimetype)
-               p->mimetype = strdup(info.mimetype);
+  len = strlen (e->thumb);
+  if ((len > 4) &&
+      (!strcmp (&e->thumb[len - 3], "jpg") ||
+       !strcmp (&e->thumb[len - 3], "JPG")) &&
+      (im = epeg_file_open (e->thumb)))
+    {
+      epeg_thumbnail_comments_get (im, &info);
+      if (info.mimetype)
+       {
+         p = epsilon_info_new ();
+         p->mtime = info.mtime;
+         p->w = info.w;
+         p->h = info.h;
+         if (info.uri)
+           p->uri = strdup (info.uri);
+         if (info.mimetype)
+           p->mimetype = strdup (info.mimetype);
        }
-       epeg_close(im);
-       return(p);
+      epeg_close (im);
+      return (p);
     }
 #endif
   if ((fp = _epsilon_open_png_file_reading (e->thumb)))
@@ -223,7 +248,7 @@
       png_init_io (png_ptr, fp);
       png_read_info (png_ptr, info_ptr);
 
-      p = epsilon_info_new();
+      p = epsilon_info_new ();
       num_text = png_get_text (png_ptr, info_ptr, &text_ptr, &num_text);
       for (i = 0; (i < num_text) && (i < 10); i++)
        {
@@ -236,174 +261,196 @@
          if (!strcmp (text.key, "Thumb::Image::Height"))
            p->h = atoi (text.text);
          if (!strcmp (text.key, "Thumb::URI"))
-           p->uri = strdup(text.text);
+           p->uri = strdup (text.text);
          if (!strcmp (text.key, "Thumb::Mimetype"))
-           p->mimetype= strdup(text.text);
+           p->mimetype = strdup (text.text);
        }
       /* png_read_end(png_ptr,info_ptr); */
       png_destroy_read_struct (&png_ptr, &info_ptr, (png_infopp) NULL);
       fclose (fp);
     }
+  if ((p->eei = epsilon_exif_info_get (e)))
+    {
+      if (p->w == 0)
+       {
+         p->w = epsilon_info_exif_props_as_int_get (p, 0xa002);
+       }
+      if (p->h == 0)
+       {
+         p->h = epsilon_info_exif_props_as_int_get (p, 0xa003);
+       }
+    }
   return (p);
 }
 
 int
-epsilon_exists(Epsilon *e)
+epsilon_info_has_exif_get (Epsilon_Info * info)
 {
-    int ok = 0, i = 0;
-    int filemtime = 0, epsilonmtime = 0;
-    struct stat filestatus;
-    char *dirs[] = { "large", "normal", "fail/epsilon" };
-    char home[PATH_MAX], buf[PATH_MAX];
+  if (info)
+    {
+      if (info->eei)
+       return (1);
+    }
+  return (0);
+}
 
-    snprintf(home, PATH_MAX, "%s", getenv("HOME"));
-    for(i = 0; i < 3; i++)
+int
+epsilon_exists (Epsilon * e)
+{
+  int ok = 0, i = 0;
+  int filemtime = 0, epsilonmtime = 0;
+  struct stat filestatus;
+  char *dirs[] = { "large", "normal", "fail/epsilon" };
+  char home[PATH_MAX], buf[PATH_MAX];
+
+  snprintf (home, PATH_MAX, "%s", getenv ("HOME"));
+  for (i = 0; i < 3; i++)
     {
 #ifdef HAVE_EPEG_H
-       snprintf(buf, PATH_MAX, "%s/.thumbnails/%s/%s.jpg", home,
-       dirs[i], e->hash);
-       if(!stat(buf, &filestatus)) 
+      snprintf (buf, PATH_MAX, "%s/.thumbnails/%s/%s.jpg", home,
+               dirs[i], e->hash);
+      if (!stat (buf, &filestatus))
        {
-           ok = 1;
-           break;
+         ok = 1;
+         break;
        }
 #endif
-       snprintf(buf, PATH_MAX, "%s/.thumbnails/%s/%s.png", home,
-       dirs[i], e->hash);
-       if(!stat(buf, &filestatus)) 
+      snprintf (buf, PATH_MAX, "%s/.thumbnails/%s/%s.png", home,
+               dirs[i], e->hash);
+      if (!stat (buf, &filestatus))
        {
-           ok = 2;
-           break;
+         ok = 2;
+         break;
        }
     }
-    if(!ok) return(EPSILON_FAIL);
-    if(!stat(e->src, &filestatus))
+  if (!ok)
+    return (EPSILON_FAIL);
+  if (!stat (e->src, &filestatus))
     {
-       filemtime = filestatus.st_mtime;
+      filemtime = filestatus.st_mtime;
 #ifdef HAVE_EPEG_H
-       if(ok == 1)
-           epsilonmtime = _epsilon_jpg_mtime_get(buf);
-       else
+      if (ok == 1)
+       epsilonmtime = _epsilon_jpg_mtime_get (buf);
+      else
 #endif
-           epsilonmtime = _epsilon_png_mtime_get(buf);
-       if(filemtime == epsilonmtime)
-           return(EPSILON_OK);
+       epsilonmtime = _epsilon_png_mtime_get (buf);
+      if (filemtime == epsilonmtime)
+       return (EPSILON_OK);
     }
-    return(EPSILON_FAIL);
+  return (EPSILON_FAIL);
 
 }
+
 int
-epsilon_generate(Epsilon *e)
+epsilon_generate (Epsilon * e)
 {
-    int iw, ih;
-    char outfile[PATH_MAX];
+  int iw, ih;
+  char outfile[PATH_MAX];
 #ifdef HAVE_EPEG_H
-    Epeg_Image *im;
-    Epeg_Thumbnail_Info info;
-    int len = 0;
+  Epeg_Image *im;
+  Epeg_Thumbnail_Info info;
+  int len = 0;
 #endif
 
-    if(!e || !e->hash || !e->src) return(EPSILON_FAIL);
+  if (!e || !e->hash || !e->src)
+    return (EPSILON_FAIL);
 #ifdef HAVE_EPEG_H
-    len = strlen(e->src);
-    if((len > 4) && 
-       (
-       !strcmp(&e->src[len-3], "jpg") ||
-       !strcmp(&e->src[len-3], "JPG")
-       ) &&
-       (im = epeg_file_open(e->src)))
-    {
-       snprintf(outfile, PATH_MAX, "%s/.thumbnails/large/%s.jpg", 
-       getenv("HOME"), e->hash);
-       epeg_thumbnail_comments_get(im, &info);
-       epeg_size_get(im, &iw, &ih);
-       if(iw > ih)
+  len = strlen (e->src);
+  if ((len > 4) &&
+      (!strcmp (&e->src[len - 3], "jpg") ||
+       !strcmp (&e->src[len - 3], "JPG")) && (im = epeg_file_open (e->src)))
+    {
+      snprintf (outfile, PATH_MAX, "%s/.thumbnails/large/%s.jpg",
+               getenv ("HOME"), e->hash);
+      epeg_thumbnail_comments_get (im, &info);
+      epeg_size_get (im, &iw, &ih);
+      if (iw > ih)
        {
-           epeg_decode_size_set(im, THUMBNAIL_SIZE,
-           THUMBNAIL_SIZE * ((double)ih/(double)iw));
+         epeg_decode_size_set (im, THUMBNAIL_SIZE,
+                               THUMBNAIL_SIZE * ((double) ih / (double) iw));
        }
-       else
+      else
        {
-           epeg_decode_size_set(im, 
-           THUMBNAIL_SIZE * ((double)iw/(double)ih),THUMBNAIL_SIZE);
-       }
-       epeg_quality_set(im, 100);
-       epeg_thumbnail_comments_enable(im, 1);
-       epeg_file_output_set(im, outfile);
-       epeg_encode(im);
-       epeg_close(im);
-       return(EPSILON_OK);
-    }
-#endif
-    {
-       int mtime;
-       char uri[PATH_MAX];
-       char format[32];
-       struct stat filestatus;
-       Imlib_Image tmp = NULL;
-       Imlib_Image src = NULL;
-       int tw = THUMBNAIL_SIZE, th = THUMBNAIL_SIZE;
-    
-       if(stat(e->src, &filestatus) != 0)
-           return(EPSILON_FAIL);
-        
-       mtime = filestatus.st_mtime;
-       if((tmp = imlib_load_image_immediately_without_cache(e->src)))
-       {
-           imlib_context_set_image(tmp);
-           snprintf(format, 32, "image/%s", imlib_image_format());
-           iw = imlib_image_get_width();
-           ih = imlib_image_get_height();
-           if(iw > ih)
-           {
-               th = THUMBNAIL_SIZE * ((double)ih/(double)iw);
-           }
-           else
-           {
-               tw = THUMBNAIL_SIZE * ((double)iw/(double)ih);
-           }
-           imlib_context_set_cliprect(0, 0, tw, th);
-           if((src = imlib_create_cropped_scaled_image(0, 0, iw, ih,
-               tw, th)))
-           {
-                 imlib_free_image_and_decache ();
-                 imlib_context_set_image (src);
-                 imlib_image_set_has_alpha (1);
-                 imlib_image_set_format ("argb");
-                 snprintf(uri, PATH_MAX, "file://%s", e->src);
-                 snprintf(outfile, PATH_MAX, "%s/.thumbnails/large/%s.png", 
-                       getenv("HOME"), e->hash);
-                 if(!_epsilon_png_write(outfile,
-                     imlib_image_get_data(), tw, th, iw, ih, format,
-                     mtime, uri))
-                 {
-                     imlib_free_image_and_decache();
-                     return(EPSILON_OK);
-                 }
-                 imlib_free_image_and_decache();
-           }
-
-       }
-    }
-    return(EPSILON_FAIL);
+         epeg_decode_size_set (im,
+                               THUMBNAIL_SIZE * ((double) iw / (double) ih),
+                               THUMBNAIL_SIZE);
+       }
+      epeg_quality_set (im, 100);
+      epeg_thumbnail_comments_enable (im, 1);
+      epeg_file_output_set (im, outfile);
+      epeg_encode (im);
+      epeg_close (im);
+      return (EPSILON_OK);
+    }
+#endif
+  {
+    int mtime;
+    char uri[PATH_MAX];
+    char format[32];
+    struct stat filestatus;
+    Imlib_Image tmp = NULL;
+    Imlib_Image src = NULL;
+    int tw = THUMBNAIL_SIZE, th = THUMBNAIL_SIZE;
+
+    if (stat (e->src, &filestatus) != 0)
+      return (EPSILON_FAIL);
+
+    mtime = filestatus.st_mtime;
+    if ((tmp = imlib_load_image_immediately_without_cache (e->src)))
+      {
+       imlib_context_set_image (tmp);
+       snprintf (format, 32, "image/%s", imlib_image_format ());
+       iw = imlib_image_get_width ();
+       ih = imlib_image_get_height ();
+       if (iw > ih)
+         {
+           th = THUMBNAIL_SIZE * ((double) ih / (double) iw);
+         }
+       else
+         {
+           tw = THUMBNAIL_SIZE * ((double) iw / (double) ih);
+         }
+       imlib_context_set_cliprect (0, 0, tw, th);
+       if ((src = imlib_create_cropped_scaled_image (0, 0, iw, ih, tw, th)))
+         {
+           imlib_free_image_and_decache ();
+           imlib_context_set_image (src);
+           imlib_image_set_has_alpha (1);
+           imlib_image_set_format ("argb");
+           snprintf (uri, PATH_MAX, "file://%s", e->src);
+           snprintf (outfile, PATH_MAX, "%s/.thumbnails/large/%s.png",
+                     getenv ("HOME"), e->hash);
+           if (!_epsilon_png_write (outfile,
+                                    imlib_image_get_data (), tw, th, iw, ih,
+                                    format, mtime, uri))
+             {
+               imlib_free_image_and_decache ();
+               return (EPSILON_OK);
+             }
+           imlib_free_image_and_decache ();
+         }
+
+      }
+  }
+  return (EPSILON_FAIL);
 }
 
 #ifdef HAVE_EPEG_H
 static int
-_epsilon_jpg_mtime_get(const char *file)
+_epsilon_jpg_mtime_get (const char *file)
 {
-    int result = 0;
-    Epeg_Image *im;
-    Epeg_Thumbnail_Info info;
+  int result = 0;
+  Epeg_Image *im;
+  Epeg_Thumbnail_Info info;
 
-    if((im = epeg_file_open(file)))
+  if ((im = epeg_file_open (file)))
     {
-       epeg_thumbnail_comments_get(im, &info);
-       if(info.mimetype)
-           result = info.mtime;
-       epeg_close(im);
+      epeg_thumbnail_comments_get (im, &info);
+      if (info.mimetype)
+       result = info.mtime;
+      epeg_close (im);
     }
-    return(result);
+  return (result);
 }
 #endif
 
@@ -439,7 +486,7 @@
 }
 
 static int
-_epsilon_png_mtime_get(const char *file)
+_epsilon_png_mtime_get (const char *file)
 {
   int result = 0;
   FILE *fp = NULL;
@@ -456,7 +503,7 @@
           png_create_read_struct (PNG_LIBPNG_VER_STRING, NULL, NULL, NULL)))
        {
          fclose (fp);
-         return(result);
+         return (result);
        }
 
       if (!(info_ptr = png_create_info_struct (png_ptr)))
@@ -464,7 +511,7 @@
          png_destroy_read_struct (&png_ptr, (png_infopp) NULL,
                                   (png_infopp) NULL);
          fclose (fp);
-         return(result);
+         return (result);
        }
       png_init_io (png_ptr, fp);
       png_read_info (png_ptr, info_ptr);
@@ -475,7 +522,7 @@
          png_text text = text_ptr[i];
 
          if (!strcmp (text.key, "Thumb::MTime"))
-           result = atoi(text.text);
+           result = atoi (text.text);
        }
       /* png_read_end(png_ptr,info_ptr); */
       png_destroy_read_struct (&png_ptr, &info_ptr, (png_infopp) NULL);
@@ -492,12 +539,11 @@
   strncpy(&tmpfile[_l-35],_buf,_ll+1); }
 
 static int
-_epsilon_png_write(const char *file, DATA32 * ptr, int tw, int th, int sw,
-int sh, char *imformat, int mtime, char *uri)
+_epsilon_png_write (const char *file, DATA32 * ptr, int tw, int th, int sw,
+                   int sh, char *imformat, int mtime, char *uri)
 {
   FILE *fp = NULL;
-  char mtimebuf[32], widthbuf[10], heightbuf[10], tmpfile[PATH_MAX] =
-  "";
+  char mtimebuf[32], widthbuf[10], heightbuf[10], tmpfile[PATH_MAX] = "";
   int i, j, k, has_alpha = 1, ret = 0;
 
 /*
@@ -591,7 +637,7 @@
       png_write_info (png_ptr, info_ptr);
       png_set_shift (png_ptr, &sig_bit);
       png_set_packing (png_ptr);
-      
+
       for (i = 0; i < th; i++)
        {
          if (has_alpha)
@@ -617,8 +663,7 @@
       if (!rename (tmpfile, file))
        {
          if (chmod (file, S_IWUSR | S_IRUSR))
-           printf ("epsilon: could not set permissions on \"%s\"!?\n",
-                   file);
+           printf ("epsilon: could not set permissions on \"%s\"!?\n", file);
        }
     }
   else
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/epsilon/src/lib/Epsilon.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -3 -r1.1.1.1 -r1.2
--- Epsilon.h   10 Dec 2003 04:46:36 -0000      1.1.1.1
+++ Epsilon.h   9 Oct 2004 18:55:23 -0000       1.2
@@ -5,53 +5,58 @@
 #define EPSILON_FAIL 0
 #define EPSILON_OK 1
 
+typedef void Epsilon_Exif_Info;
+
 struct _Epsilon
 {
-    char *hash;
-    char *src;
-    char *thumb;
+  char *hash;
+  char *src;
+  char *thumb;
 };
 typedef struct _Epsilon Epsilon;
 
 struct _Epsilon_Info
 {
-    char *uri;
-    unsigned long long int mtime;
-    int w, h;
-    char *mimetype;
+  char *uri;
+  unsigned long long int mtime;
+  int w, h;
+  char *mimetype;
+  Epsilon_Exif_Info *eei;
 };
 typedef struct _Epsilon_Info Epsilon_Info;
 
-void epsilon_init(void);
+
+void epsilon_init (void);
 
 /* construct destruct */
-void epsilon_free(Epsilon *e);
-Epsilon* epsilon_new(const char *file);
+void epsilon_free (Epsilon * e);
+Epsilon *epsilon_new (const char *file);
 
 /*
  * the source filename
  */
-const char* epsilon_file_get(Epsilon *e);
+const char *epsilon_file_get (Epsilon * e);
 /*
  * the thumbnail filename
  */
-const char* epsilon_thumb_file_get(Epsilon *e);
+const char *epsilon_thumb_file_get (Epsilon * e);
 /* 
  * returns EPSILON_FAIL if no thumbnail exists, EPSILON_OK if it does
  */
-int epsilon_exists(Epsilon *e);
+int epsilon_exists (Epsilon * e);
 /* 
  * returns EPSILON_FAIL if no errors, EPSILON_OK if write goes ok
  */
-int epsilon_generate(Epsilon *e);
+int epsilon_generate (Epsilon * e);
 
 /*
  * get the meta information associated with the epsilon
  */
-Epsilon_Info * epsilon_info_get(Epsilon *e);
-/*
- * free the information struct epsilon gave you
- */
-void epsilon_info_free(Epsilon_Info *info);
+Epsilon_Info *epsilon_info_get (Epsilon * e);
+
+int epsilon_exif_info_props_as_int_get (Epsilon_Info * ei, long prop);
+const char *epsilon_exif_info_props_as_str_get (Epsilon_Info * ei, long prop);
+void epsilon_exif_info_props_print (Epsilon_Info * ei);
+int epsilon_info_has_exif_get (Epsilon_Info * ei);
 
 #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
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to