Enlightenment CVS committal

Author  : codewarrior
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/bin


Modified Files:
        e_thumb.c 


Log Message:
- add method to fetch a thumb's width and height without having to decode the 
pixels.

===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_thumb.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -3 -r1.15 -r1.16
--- e_thumb.c   22 Nov 2005 09:27:25 -0000      1.15
+++ e_thumb.c   8 Dec 2005 07:55:10 -0000       1.16
@@ -138,6 +138,52 @@
    return strdup(thumb);   
 }
 
+/* return the width and height of a thumb, if from_eet is set, then we
+ * assume that the file being passed is the thumb's eet
+ */
+void
+e_thumb_geometry_get(char *file, int *w, int *h, int from_eet)
+{
+   Eet_File *ef;   
+   
+   if(!from_eet)
+     {
+       char *eet_file;
+       
+       eet_file = _e_thumb_file_id(file);
+       if(!eet_file)
+         {
+            if(w) *w = -1;
+            if(h) *h = -1;
+            return;
+         }
+       ef = eet_open(eet_file, EET_FILE_MODE_READ);
+       if (!ef)
+         {
+            if(w) *w = -1;
+            if(h) *h = -1;
+            return;
+         }
+     }
+   else
+     {
+       ef = eet_open(file, EET_FILE_MODE_READ);
+       if (!ef)
+         {
+            if(w) *w = -1;
+            if(h) *h = -1;
+            return;
+         }
+     }
+   if(!eet_data_image_header_read(ef, "/thumbnail/data/", w, h, NULL, NULL, 
+                                 NULL, NULL))
+     {
+       if(w) *w = -1;
+       if(h) *h = -1;
+       return;
+     }      
+}
+
 /* return true if the saved thumb exists OR if its an eap */
 int
 e_thumb_exists(char *file)




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to