When using imagesize.get() on anything which is not supported (text files, empty files, etc.), the method just returns (-1,-1). I would suggest raising a ValueError instead (as is already the case when trying a random XML file, since is is parsed as SVG).
On the other hand, that would be a behavior change, so maybe either document the current behavior or bump the major version if this change is implemented?
When using
imagesize.get()
on anything which is not supported (text files, empty files, etc.), the method just returns(-1,-1)
. I would suggest raising a ValueError instead (as is already the case when trying a random XML file, since is is parsed as SVG).On the other hand, that would be a behavior change, so maybe either document the current behavior or bump the major version if this change is implemented?