Thanks to visit codestin.com
Credit goes to github.com

Skip to content

imagesize.get(image_path) returns incorrect size for .webp image #135672

Closed as not planned
@araleza

Description

@araleza

Bug report

Bug description:

I'm working with some code that calls:

img_size = imagesize.get(path_to_image)

This calls into python3.12's imagesize.py file, which correctly detects the file as a .webp image. But, the image size returned is 767x1343, where GIMP and Ubuntu's Dolphin both indicate that this .webp file is actually 768x1344.

I tried to attach the .webp file directly to this bug report, but that file extension isn't accepted. (File type not allowed: .webp). So I've changed the extension to .txt. You can save this file and rename it back to .webp:

this_image_is_768_x_1344.txt

I made it a plain gray image, but the bug still showed even when it wasn't a single color.

CPython versions tested on:

3.12

Operating systems tested on:

Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions