Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JPEG image not handled. #1430

Open
jnafzig opened this issue Sep 10, 2024 · 2 comments
Open

JPEG image not handled. #1430

jnafzig opened this issue Sep 10, 2024 · 2 comments

Comments

@jnafzig
Copy link

jnafzig commented Sep 10, 2024

error2
The above image can't be added to a document despite being an apparently valid jpeg.

from docx import Document

doc = Document(None)
with open('error.jpg', 'rb') as f:
    doc.add_picture(f)

This raises docx.image.exceptions.UnrecognizedImageError. Apparently it doesn't match any existing header format listed in SIGNATURES.

@jnafzig
Copy link
Author

jnafzig commented Sep 10, 2024

This was tested on python-docx 1.1.2

@TheZ3ro
Copy link

TheZ3ro commented Nov 26, 2024

Just to understand: Which device did you use to take this photo? Did you edited/converted it with some software or sent compressed via some IM chat?

The image is a plain JPG but it's missing all the Exif information inside of it.

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

No branches or pull requests

2 participants