Skip to content

Simplification.#1

Open
podgorskiy wants to merge 1 commit intomasterfrom
simplification
Open

Simplification.#1
podgorskiy wants to merge 1 commit intomasterfrom
simplification

Conversation

@podgorskiy
Copy link
Copy Markdown
Member

BTW, if you need to read image size without decoding the whole jpeg, use PIL. It reads file header first and never reads the body unless you access the data.
CV2 is forced to return numpy array and will decode the whole file.

    from PIL import Image

    img = Image.open('some path')
    w, h = img.size

BTW, if you need to read image size without decoding the whole jpeg, use PIL. It reads file header first and never reads the body unless you access the data.
CV2 is forced to return numpy array and will decode the whole file.
@gidoretto
Copy link
Copy Markdown
Member

Pillow does not do that?

PIL is kind of old.

@podgorskiy
Copy link
Copy Markdown
Member Author

@gidoretto, sure I'm talking about Pillow, but the package is still called PIL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants