image_size icon indicating copy to clipboard operation
image_size copied to clipboard

Variables `w` and `h` possibly unassigned during JPEG image size computation

Open laclouis5 opened this issue 2 years ago • 0 comments

I'm using this code in a project and while running the linter with type checking enabled (Pylint) I found what look like an error in the decoding of the image size of the JPEG variant here:

https://github.com/scardine/image_size/blob/fb25377f42fc6c90c280462a87a41cf20cc2ac0e/get_image_size.py#L144-L171

More specifically, if the if branch at line 156 is not triggered, the variables h and w are not assigned any value. Thus, line 164 and 165 fails and the image size cannot be computed. Is there something missing in the else branch?

laclouis5 avatar Nov 17 '22 14:11 laclouis5