-
-
Notifications
You must be signed in to change notification settings - Fork 886
[fix]: Fixed Unknown App0 Marker add profileResolver missing #2566
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
Changes from 1 commit
c7f3aa4
412e451
ca1fd46
48cecd3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -24,6 +24,14 @@ internal static class ProfileResolver | |||||||||||
| (byte)'J', (byte)'F', (byte)'X', (byte)'X', (byte)'\0' | ||||||||||||
| }; | ||||||||||||
|
|
||||||||||||
| /// <summary> | ||||||||||||
| /// Gets the \n[ID or 10 91 73 68 32 specific markers. | ||||||||||||
| /// </summary> | ||||||||||||
| public static ReadOnlySpan<byte> OSQidMaker => new[] | ||||||||||||
| { | ||||||||||||
| (byte)'\n', (byte)'[', (byte)'I', (byte)'D', (byte)' ' | ||||||||||||
| }; | ||||||||||||
|
||||||||||||
| public static ReadOnlySpan<byte> OSQidMaker => new[] | |
| { | |
| (byte)'\n', (byte)'[', (byte)'I', (byte)'D', (byte)' ' | |
| }; | |
| public static ReadOnlySpan<byte> OSQidMaker => new[] { (byte)'\n', (byte)'[', (byte)'I', (byte)'D', (byte)' ' }; |
I'd like to have it written as one-liner, because when we are able to use ut8-literals it's easier to find & replace these.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a good suggestion, but the other properties of the class already follow this same pattern, so I chose to keep it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While this works, I'm not sure it's the correct fix.
I think we might be able to simply remove the throw when the marker doesn't match a JFIF one and skip the remaining bytes.
What is OSQidMaker? Can you please supply more information?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In fact, in my research I didn't find markers that specified such a conversion starting with these bytes, but I have images of a camera that always has these bytes at the beginning. I also had success in all tests when ignoring this if but I don't know what more problems this could cause. I'm running a fork of the lib in my application and I don't get any more errors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The JFIF JFXX headers contain metadata and we can actually operate without them. Your images actually contain a JFIF header in an APP0 block just after the camera junk.
I can’t accept the fix as-is because the values are non-standard so we should try a more robust solution as suggested