← 返回首页
fix: fallback to 72 dpi when image header is 0 (#1494) by thiagocborghi · Pull Request #1505 · python-openxml/python-docx · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

fix: fallback to 72 dpi when image header is 0 (#1494)#1505

Open
thiagocborghi wants to merge 1 commit into
python-openxml:masterfrom
thiagocborghi:fix/zero-dpi-fallback
Open

fix: fallback to 72 dpi when image header is 0 (#1494)#1505
thiagocborghi wants to merge 1 commit into
python-openxml:masterfrom
thiagocborghi:fix/zero-dpi-fallback

Conversation

Copy link
Copy Markdown

thiagocborghi commented Jul 8, 2025
edited
Loading

Adds a 72-dpi fallback when an image header declares 0 dpi, preventing the
ZeroDivisionError reported in #1494.

The fix changes two getter methods (horz_dpi / vert_dpi) and adds a
regression test with a 0-dpi JPEG fixture.

thiagocborghi changed the title Fallback to 72 dpi when image header is 0 (fix #1497 / #1494) Fallback to 72 dpi when image header is 0 (fix #1494) Jul 8, 2025
thiagocborghi force-pushed the fix/zero-dpi-fallback branch from 06c03d6 to df7b5bb Compare July 8, 2025 22:18
thiagocborghi changed the title Fallback to 72 dpi when image header is 0 (fix #1494) fix: fallback to 72 dpi when image header is 0 (#1494) Jul 8, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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

Footer

© 2026 GitHub, Inc.