Error with latest IDE/firmware on image.gamma function - more breaking changes?

The following code used to work fine, but now throws the error: “TypeError: extra positional arguments given”

img.gamma(1.0,1.5,0.0)

…but if I use

img.gamma(gamma=1.0,contrast=1.5,brightness=0.0)

…it works.

There seem to be a LOT of breaking changes in this latest release. Is there a summary of those changes that will cause existing code to not work?

Thanks.

Hi, we’ve been updating the library to use the micropython argument parsing framework. Before, our code used a custom parsing method that didn’t enforce keyword argument rules.

So, any breaking change is related to keyword arguments being required now. We will be updating all code to this. Please note that before, if you passed a keyword that wasn’t used, it would just silently not fail. Now, the system is strict about this. You also cannot mispell the keyword argument either and have the function continue to work.

This also applies to positional arguments too. Now, extra ones are caught and an error is thrown.

We have updated everything but the Image module to the new argument framework. It will take a while for us to update everything in the image module but we will be updating methods each release until the whole thing is using modern argument parsing.

1 Like

Got it. Thanks! Might be worthy of a pinned post. :wink:

Yeah we should have kept track of breaking changes, we’ll do that for future releases.

1 Like