tags:

views:

54

answers:

1
+1  Q: 

Jython, ImageInfo

Hi,

I trying to use ImageInfo and Jython to get information from a image on my harddrive.

I have imported the module fine but keep getting this error:

TypeError: setInput(): expected 2 args; got 1

And this is the code I am trying to use:

filename = "C:\\image.jpg"
img = ImageInfo.setInput(filename)

Could anyone point out what I am doing wrong.

Cheers

Eef

+2  A: 

The missing argument Jython complains about is the ImageInfo object itself, which doesn't exist yet. You must construct it first. So:

filename = "C:\\image.jpg"
ii = ImageInfo()
img = ii.setInput(filename)

or

filename = "C:\\image.jpg"
img = ImageInfo().setInput(filename)

may work also.

Joonas Pulakka