Update of /cvsroot/freevo/freevo/src/util
In directory sc8-pr-cvs1:/tmp/cvs-serv26425

Modified Files:
        videothumb.py 
Log Message:
make image max 300x300

Index: videothumb.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/util/videothumb.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** videothumb.py       4 Jan 2004 11:16:32 -0000       1.1
--- videothumb.py       4 Jan 2004 13:07:14 -0000       1.2
***************
*** 14,17 ****
--- 14,20 ----
  # -----------------------------------------------------------------------
  # $Log$
+ # Revision 1.2  2004/01/04 13:07:14  dischi
+ # make image max 300x300
+ #
  # Revision 1.1  2004/01/04 11:16:32  dischi
  # add function to create a thumbnail from videofiles
***************
*** 46,50 ****
  import config
  import popen3
! 
  
  def snapshot(videofile, imagefile, pos=None):
--- 49,53 ----
  import config
  import popen3
! import Image
  
  def snapshot(videofile, imagefile, pos=None):
***************
*** 60,64 ****
      if out:
          print out
! 
  
  
--- 63,77 ----
      if out:
          print out
!     if vfs.isfile(imagefile):
!         try:
!             image = Image.open(imagefile)
!             if image.size[0] > 300 and image.size[1] > 300:
!                 image.thumbnail((300,300), Image.ANTIALIAS)
!             if image.mode == 'P':
!                 image = image.convert('RGB')
!             image = image.crop((5, 0, image.size[0]-10, image.size[1]))
!             image.save(imagefile)
!         except:
!             pass
  
  
***************
*** 94,98 ****
              shutil.copy(capture, imagefile)
          except:
!             shutil.copy(capture, os.path.join(config.OVERLAY_DIR, imagefile[1:]))
      else:
          print "error creating capture for %s" % filename
--- 107,111 ----
              shutil.copy(capture, imagefile)
          except:
!             shutil.copy(capture, vfs.getoverlay(imagefile[1:]))
      else:
          print "error creating capture for %s" % filename




-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to