lundi 23 février 2015

cImage python module error

I'm writing a function to convert and display an image to negative, when i call the function i get this error message:



Traceback (most recent call last):
File "C:/Users/Niggers/PycharmProjects/Librophyton/Procdeimagenes/test.py",line 32, in <module>
makeNegative(dude)
File "C:\Python34\lib\ImageProcess.py", line 16, in makeNegative
old = FileImage(imageFile)
File "C:\Python34\lib\cImage.py", line 398, in __init__
super(FileImage, self).__init__(fname = thefile)
File "C:\Python34\lib\cImage.py", line 241, in __init__
self.loadImage(fname)
File "C:\Python34\lib\cImage.py", line 270, in loadTkImage
sufstart = fname.rfind('.')
AttributeError: 'FileImage' object has no attribute 'rfind'


Here is the function:



def makeNegative(imageFile):

window = ImageWin("Proceso de imagen", 1000-100, 900)
old = FileImage(imageFile)
old.draw(window)
window.exitOnClick()

w = old.getWidth()
h = old.getHeight()
new = EmptyImage(w,h)

for row in range(h):

for col in range(w):

pixelviejo = old.getPixel(col,row)
pixelnuevo = pixelNeg(pixelviejo)
new.setPixel(col, row, pixelnuevo)
new.setPosition(w+1, 0)
new.draw(window)
window.exitOnClick()


And here is the funciton call:



dude = FileImage("factores_de_conversion.gif" )
makeNegative(dude)


Any idea how to solve this? or how should i modify the module?


Aucun commentaire:

Enregistrer un commentaire