2011-06-17 15:50:14 +02:00
|
|
|
#!/usr/bin/python
|
|
|
|
|
|
|
|
import logging
|
2011-06-18 14:34:52 +02:00
|
|
|
import gc
|
2011-06-17 15:50:14 +02:00
|
|
|
|
|
|
|
import vipsimage
|
|
|
|
|
|
|
|
logging.basicConfig(level = logging.DEBUG)
|
|
|
|
|
2011-06-18 14:34:52 +02:00
|
|
|
# test unref
|
|
|
|
for i in range (1,10):
|
|
|
|
a = vipsimage.VipsImage('/home/john/pics/healthygirl.jpg')
|
|
|
|
|
2011-06-17 15:50:14 +02:00
|
|
|
# should work
|
|
|
|
a = vipsimage.VipsImage('/home/john/pics/healthygirl.jpg')
|
2011-06-18 14:34:52 +02:00
|
|
|
print 'width =', a.width()
|
|
|
|
print 'height =', a.height()
|
|
|
|
print 'bands =', a.bands()
|
|
|
|
print 'format =', vipsimage.VipsBandFormat.name(a.format())
|
|
|
|
print 'coding =', vipsimage.VipsCoding.name(a.coding())
|
|
|
|
print 'interpretation =', vipsimage.VipsInterpretation.name(a.interpretation())
|
|
|
|
print 'xres =', a.xres()
|
|
|
|
print 'yres =', a.yres()
|
|
|
|
print 'xoffset =', a.xoffset()
|
|
|
|
print 'yoffset =', a.yoffset()
|
2011-06-17 15:50:14 +02:00
|
|
|
|
|
|
|
# should raise an error
|
2011-06-18 14:34:52 +02:00
|
|
|
# a = vipsimage.VipsImage('banana')
|
|
|
|
|
|
|
|
print 'starting shutdown ...'
|
|
|
|
del a
|
|
|
|
# sometimes have to do several GCs to get them all, not sure why
|
|
|
|
for i in range(10):
|
|
|
|
gc.collect ()
|
|
|
|
print 'shutdown!'
|
|
|
|
|