Skip to content

Fix large images still not being openable#59

Open
Filoppi wants to merge 1 commit into13thsymphony:release-1.1.0from
Filoppi:release-1.1.0
Open

Fix large images still not being openable#59
Filoppi wants to merge 1 commit into13thsymphony:release-1.1.0from
Filoppi:release-1.1.0

Conversation

@Filoppi
Copy link

@Filoppi Filoppi commented Jan 21, 2023

5120x1440 jxr HDR images fail to be opened when the app is in a maxed out window, because the histogram still fails to draw (EndDraw() has an exception within itself, and returns error D1225). I haven't really spent much time analyzing how the histogram is used, but I have found that the jxr image is visualized exactly the same way whether the EndDraw() failed or not (thus the max luminance (CLL) remains n/a). I can manage to open these images, but only if the app started in a small window. If it's maxed out, it will throw the error.

I'm on the latest version of Win 11 and have a recent high end Nvidia card (I don't think it matters). My resolution is set to 5120x1440 and DPI to 100% (so 96).

I have found that changing the SetDpi() call from 96 to 1 avoids the exception to be throw, though it actually kind of breaks the final image rendering and the max luminance value. I know that makes no sense, I was just messing around.

Before the code was changed to add the SetDpi() workaround (from @imbushuo), it errored out even more often, though I'm not sure exactly what improved.

This is unrelated to this PR, but I also noticed the max luminance calculated by the app depends on the window size. You can test it by making the window tiny and opening the same image multiple times.
I suppose the histogram is rendered in a way that depends on the window size, while it shouldn't?

5120x1440 jxr HDR images fail to be opened when the app is in a maxed out window, because the histogram still fails to draw (EndDraw() has an exception within itself, and returns error D1225).
I haven't really spent time analyzing what the histogram is used for, but I have found that the jxr image is visualized exactly the same way whether the EndDraw() failed or not (thus the max luminance remains n/a).
I can manage to open these images, but only if the app started in a small window. If it's maxed out, it will throw the error.

I'm on the latest version of Win 11 and have a recent high end Nvidia card (I don't think it matters).
My resolution is set to 5120x1440 and DPI to 100% (so 96).

I have found that changing the "SetDpi()" call from 96 to 1 avoids the exception to be throw, though it actually kind of breaks the final image rendering.
I know that makes no sense, I was just messing around.

Before the code was changed to add the "SetDpi()" workaround, it errored out even more often, though I'm not sure exactly what improved.
@Filoppi
Copy link
Author

Filoppi commented Jan 28, 2023

This fork has some of the some fixes for the stuff I mentioned above:
https://github.com/EndlesslyFlowering/HDRImageViewer

@Filoppi
Copy link
Author

Filoppi commented Aug 3, 2023

@13thsymphony hey, sorry to bother, just wondering if there was any intention of merging this?

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.

1 participant

Comments