Update of /cvsroot/freevo/freevo/src/helpers
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19740/src/helpers
Modified Files:
cache.py
Log Message:
improve caching
Index: cache.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/helpers/cache.py,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -d -r1.30 -r1.31
*** cache.py 21 Mar 2004 09:39:54 -0000 1.30
--- cache.py 22 Mar 2004 11:04:51 -0000 1.31
***************
*** 12,15 ****
--- 12,18 ----
# -----------------------------------------------------------------------
# $Log$
+ # Revision 1.31 2004/03/22 11:04:51 dischi
+ # improve caching
+ #
# Revision 1.30 2004/03/21 09:39:54 dischi
# check for updated mmpython
***************
*** 186,190 ****
import cStringIO
import stat
- import Image
print 'checking thumbnails...................................',
--- 189,192 ----
***************
*** 212,215 ****
--- 214,224 ----
pass
+ for bad_dir in ('.xvpics', '.thumbnails', '.pics'):
+ if filename.find('/' + bad_dir + '/') > 0:
+ try:
+ files.remove(filename)
+ except:
+ pass
+
print '%s file(s)' % len(files)
***************
*** 220,251 ****
print ' %4d/%-4d %s' % (files.index(filename)+1, len(files), fname)
! sinfo = os.stat(filename)
! thumb = vfs.getoverlay(filename + '.raw')
! try:
! if os.stat(thumb)[stat.ST_MTIME] > sinfo[stat.ST_MTIME]:
! continue
! except OSError:
! pass
!
! try:
! image = Image.open(filename)
! except:
! continue
!
! if not image:
! continue
!
! try:
! if image.size[0] > 300 and image.size[1] > 300:
! image.thumbnail((300,300), Image.ANTIALIAS)
!
! if image.mode == 'P':
! image = image.convert('RGB')
- # save for future use
- data = (image.tostring(), image.size, image.mode)
- util.save_pickle(data, thumb)
- except:
- print 'error caching image %s' % filename
if files:
print
--- 229,234 ----
print ' %4d/%-4d %s' % (files.index(filename)+1, len(files), fname)
! util.cache_image(filename)
if files:
print
***************
*** 469,472 ****
--- 452,458 ----
delete_old_files_2()
+ # we have time here, don't use exif thumbnails
+ config.IMAGE_USE_EXIF_THUMBNAIL = 0
+
cache_directories(rebuild)
cache_thumbnails()
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog