On Sun, 2003-03-30 at 08:40, Metnetsky wrote:
> I can't seem to find any good documentation/examples on GDK with
> Python.  I'm not trying to do much, just open an image, shrink, and save
> under a new name.  Simply put, I have a few hundred photos that need to
> be cut in half by exactly 50%.  The program doesn't need an interface,
> it should be run from a command prompt with a directory path passed as
> an argument.  All images in the path are loaded and converted.  Any
> suggestions on where/how to begin this?
> 
> ~ Matthew

I think what you are looking for is gtk.gdk.Pixbuf. As a starting point

import gtk
pixbuf = gtk.gdk.pixbuf_new_from_file( 'file' )
scaled = pixbuf.scale_simple( pixbuf.get_width()/2,
         pixbuf.get_height()/2, gtk.gdk.INTERP_BILINEAR )
scaled.save( 'scaled.png', 'png' )

The documenation on this topic isn't the best but maybe you should look
here:
http://www.gnome.org/~james/pygtk-docs/class-gdkpixbuf.html

Thomas


_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to