Skip to content

Improve binary/uri ProfileImage handling#183

Merged
crobibero merged 4 commits into
jellyfin:masterfrom
dshoreman:ldap-binary-avatar-fix
Jun 10, 2025
Merged

Improve binary/uri ProfileImage handling#183
crobibero merged 4 commits into
jellyfin:masterfrom
dshoreman:ldap-binary-avatar-fix

Conversation

@dshoreman

@dshoreman dshoreman commented Jun 6, 2025

Copy link
Copy Markdown
Contributor

Problem

Some binary images seem to falsely trip the TryNewmaybe because it contains a string like 567890:hjklmnopqrstuvwxyz in a couple spots—so it throws an InvalidOperationException when it gets to the uri.Scheme checks, thus causing both login and the image sync task to fail.

Solutions

This PR solves the first issue by scanning for any non-printable ASCII control codes (apart from \r, \n etc.) in the stringValue to avoid the false positive entirely.

To solve the second issue for relative paths (or any URI without a scheme), an additional check is added to first ensure the URI is an absolute one. Still an exception, but hopefully much clearer for the user as to what went wrong.

@crobibero

Copy link
Copy Markdown
Member

Build is fine, just a ci issue since we released rc1 yesterday.

dshoreman added 4 commits June 8, 2025 23:27
Accessing `uri.Scheme` throws InvalidOperationException because it's
only supported for absolute URIs. This avoids that trap and throws a
more friendly error message for unsupported relative URIs.
While some blobs are already detected fine, others were wrongly detected
as "valid" URIs resulting in an exception when it realises that's false.

This commit avoids false positives by scanning for ASCII control chars,
which should also hopefully fix the avatar sync task at the same time.
@dshoreman dshoreman force-pushed the ldap-binary-avatar-fix branch from 3f08663 to 69b561a Compare June 8, 2025 22:31
@dshoreman

dshoreman commented Jun 8, 2025

Copy link
Copy Markdown
Contributor Author

Bumped the bump in readme to save a second bump later (but can drop it if you'd rather include the patch in #182)

@crobibero crobibero merged commit 68f1a3c into jellyfin:master Jun 10, 2025
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