-
-
Notifications
You must be signed in to change notification settings - Fork 500
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
Images won't open in config.xml presence #765
Comments
Sorry, I don't know what else to say. It behaves exactly like I said. When I try to open the image, cursor just thinks for a second and that's it. I tried with different locations, folder contents, image types, config contents (it can even be empty file), no difference. And once config is renamed, moved or deleted, image opens immidiately. |
Hmmm, it works in presence of IG theme config though. If I had to guess, I'd say IG confuses them somehow? |
Interesting bug. Easy enough to repro. Thank you for the report! The trick is that the config.xml file must be empty, or invalid. The problem does not manifest if a correct config.xml file is used. The first problem is in Theme.cs, LoadTheme(). When double-clicking on a file to open it using IG as the associated viewer, the current working directory for IG is the folder where the image resides. The first time LoadTheme() is invoked, the input path is empty. In this case, if a (bogus) file named config.xml is in the image folder, it will be found, IG will try to use it, throw an exception, and shut down. So issue #1: LoadTheme needs exception handling for a bogus XML file. [Side note: when IG is invoked via RMB->Open With..., the current working directory is "C:\windows\system32". So an empty/bogus config.xml file in that folder would cause the same problem.] Issue #2: the second time LoadTheme() is called, the full path to the Themes folder relative to the App Directory is provided. So, why is LoadTheme() called twice? Why is the first call with an empty path? [In my case I'm not using the Default theme.] Issue #3: what happens if the theme config.xml file in the installation folder is deleted or corrupted? IG behaves the same as in the original report: falls over silently. As I'm not in a position to attempt to solve any of these right now, here are my suggestions:
|
@fire-eggs I worked on your forth suggestion. changed every reference from |
Issue #765 Images won't open in config.xml presence
Shipped in IG Moon: https://imageglass.org/moon |
System information:
To Reproduce
Actual behavior:
Nothing happens, IG won't start. But if xml file is deleted or renamed, image opens in IG with no problem.
Expected behavior:
IG should start.
Additional context:
"RMB -> Open with -> ImageGlass" works nonetheless.
The text was updated successfully, but these errors were encountered: