Skip to content

Conversation

kohtala
Copy link

@kohtala kohtala commented Aug 19, 2025

The magic package for libmagic support has many different implementations that conflict with each other and I believe do not work on Windows.

The fallback attempt to use mimetypes on a tempfile does not work because on Linux the temporary file is created with O_TMPFILE and the file name is integer for the file descriptor. On Windows it works no better because it relies on the file name extension and a temporary file does not have an extension set based on the content.

For the avatar only JPEG, GIF and PNG are supported in Jira Could REST API and also BMP and WBMP for Data Center. Because we have only these types to recognize, it is easier for us to decide which it is ourselves than using a dependency.

This replaces solutions in #1847 #1867, #1891 and closes #1801 which should have been closed already.

Copy link

github-actions bot commented Aug 19, 2025

Label error. Requires exactly 1 of: breaking, build, chore, ci, docs, feat, fix, perf, refactor, style, test. Found: dependencies. Follow https://www.conventionalcommits.org to get auto-labeling to work correctly.

The magic package for libmagic support has many different implementations
that conflict with each other. For the avatar only JPEG, GIF and PNG are
supported in Jira Could REST API and also BMP and WBMP for Data Center,
so we can decide which it is ourselves.
@kohtala kohtala changed the title Recognize avatar content type by ourselves without libmagic Remove unreliable libmagic dependency and broken use of mimetypes Oct 15, 2025
@kohtala
Copy link
Author

kohtala commented Oct 15, 2025

I updated the description to be clearer on what are the problems in the current implementation and why this solution covers all the use cases we can support.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make dependency on pillow optional

2 participants