Skip to content

fix: make Image(retina=True) work with WebP#15276

Merged
Carreau merged 1 commit into
ipython:mainfrom
flying-sheep:retina-webp
Jul 4, 2026
Merged

fix: make Image(retina=True) work with WebP#15276
Carreau merged 1 commit into
ipython:mainfrom
flying-sheep:retina-webp

Conversation

@flying-sheep

@flying-sheep flying-sheep commented Jun 28, 2026

Copy link
Copy Markdown
Collaborator

The code exists, seems like it was forgotten in #14526.

cc @Carreau and @westurner

@westurner

westurner commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Could be:

DPI_HI = 192
#DPI_RETINA = 

Image(,dpi=DPI_HI)

@westurner

westurner commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

From Arch wiki > HiDPI: https://wiki.archlinux.org/title/HiDPI :

96 DPI screens are regarded as comfortable for most people to read ~12pt font on, and is about where most "low-DPI" monitors fall. HiDPI screens are around 192 DPI and greater, with some screens falling in the middle ("medium PPI").

@flying-sheep

Copy link
Copy Markdown
Collaborator Author

@westurner I think it’s a great idea to make this more generic, and I’d happily help, but this PR is just a very small fix and I don’t want to increase its scope.

@Carreau Carreau added this to the 9.16 milestone Jul 4, 2026
@Carreau Carreau merged commit bd9659b into ipython:main Jul 4, 2026
24 checks passed
@Carreau

Carreau commented Jul 4, 2026

Copy link
Copy Markdown
Member

thanks !

@flying-sheep

flying-sheep commented Jul 5, 2026

Copy link
Copy Markdown
Collaborator Author

Great! I have a branch in which I refactor the image format handling – should I do a PR separately with that or should I do the DPI stuff in there?

The idea is that it becomes an enum which centrally handles format name, extension, mime type, and shape deriving. That way when modifying the code, it’s no longer possible to forget a patch: #15287

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.

3 participants