Author: dmeyer
Date: Mon Feb 20 15:56:01 2006
New Revision: 1209

Modified:
   trunk/imlib2/src/__init__.py
   trunk/imlib2/src/image.py
   trunk/imlib2/src/imlib2.c

Log:
make it possible to load an image without cache

Modified: trunk/imlib2/src/__init__.py
==============================================================================
--- trunk/imlib2/src/__init__.py        (original)
+++ trunk/imlib2/src/__init__.py        Mon Feb 20 15:56:01 2006
@@ -49,6 +49,14 @@
     "max-size": 16*1024   # 16 MB
 }
 
+def open_without_cache(file):
+    """
+    Create a new image object from the file 'file' without using the
+    internal cache.
+    """
+    return Image(file, False)
+
+
 def open(file):
     """
     Create a new image object from the file 'file'.

Modified: trunk/imlib2/src/image.py
==============================================================================
--- trunk/imlib2/src/image.py   (original)
+++ trunk/imlib2/src/image.py   Mon Feb 20 15:56:01 2006
@@ -42,7 +42,7 @@
     Image object may be created via the new() and open() module functions.
     """
 
-    def __init__(self, image_or_filename):
+    def __init__(self, image_or_filename, use_cache=True):
         """
         Create a new Image object.
 
@@ -53,7 +53,7 @@
                              the image.
         """
         if type(image_or_filename) in types.StringTypes:
-            self._image = _Imlib2.open(image_or_filename)
+            self._image = _Imlib2.open(image_or_filename, use_cache)
         elif isinstance(image_or_filename, Image):
             self._image = image_or_filename.copy()._image
         elif type(image_or_filename) == _Imlib2.Image:

Modified: trunk/imlib2/src/imlib2.c
==============================================================================
--- trunk/imlib2/src/imlib2.c   (original)
+++ trunk/imlib2/src/imlib2.c   Mon Feb 20 15:56:01 2006
@@ -145,11 +145,12 @@
 {
     char *file;
     Image_PyObject *image;
-
-    if (!PyArg_ParseTuple(args, "s", &file))
+    int use_cache = 1;
+    
+    if (!PyArg_ParseTuple(args, "s|i", &file, &use_cache))
         return NULL;
  
-    image = _imlib2_open(file, 1);
+    image = _imlib2_open(file, use_cache);
     if (!image)
         return NULL;
     return (PyObject *)image;


-------------------------------------------------------
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://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to