Ruben2776 / PicView

Fast, free and customizable image viewer for Windows 10 and 11.
https://picview.org
Other
995 stars 66 forks source link

`settings` is crashing the app #51

Closed cannibalox closed 2 years ago

cannibalox commented 2 years ago

Describe the bug every time I go to settings, the app closes without any warning after a few seconds (cursor is thinking - in spinning blue circle mode). event viewer log:

Application: PicView.exe
CoreCLR Version: 6.0.21.48005
.NET Version: 6.0.0-rc.2.21480.5
Description: The process was terminated due to an unhandled exception.
Exception Info: System.Globalization.CultureNotFoundException: Culture is not supported. (Parameter 'name')
zh_CN is an invalid culture identifier.
   at System.Globalization.CultureInfo..ctor(String name, Boolean useUserOverride)
   at System.Globalization.CultureInfo..ctor(String name)
   at PicView.Views.Windows.SettingsWindow.<.ctor>b__0_0(Object <p0>, EventArgs <p1>)
   at System.Windows.Window.OnContentRendered(EventArgs e)
   at System.Windows.Window.<>c.<PostContentRendered>b__204_0(Object arg)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(Object obj)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.Run()
   at System.Windows.Application.RunDispatcher(Object ignore)
   at System.Windows.Application.RunInternal(Window window)
   at System.Windows.Application.Run()
   at PicView.App.Main()

running v1.5.5 portable with admin rights on win 10 x64 (tried the standalone portable and the .net-dependant version with similar output)

Ruben2776 commented 2 years ago

Sorry about that. Would you mind downloading this version and tell me if it fixed it for you? https://sourceforge.net/projects/picview/files/PicView-v1.5.5_win-x64-portable-Test-SettingsLanguage.zip/download

cannibalox commented 2 years ago

it's working thank you ! a quick question : I can zoom IN (>100%) but I can't zoom out lower than 100%, is that normal ?

Ruben2776 commented 2 years ago

Not being able to zoom out from the size calculated to fit on your screen is by design. I don't see the point in making the image smaller. And it's also because you can't pan the image (drag it around), unless it's zoomed in, to avoid confusing behavior.

cannibalox commented 2 years ago

I don't see the point in making the image smaller. And it's also because you can't pan the image (drag it around), unless it's zoomed in, to avoid confusing behavior.

if the images are really bigger than your screen (say 8000x6000px), and you don't want them to fill all the available height of the monitor, then currently, the best option seems to be: type 3>resize window to small size>type 3 again to auto fit the pic to the small windows size... this would be much faster if - would zoom out as in other images viewers (nomacs/xnview/pureref/faststone/irfan/...). also if the smallest windows size could be smaller that could be useful.

using a smaller view for reference is a pretty common use-case for graphic artists or photographers looking to get an overview of the composition at smaller scale, or comparing pictures.

Ruben2776 commented 2 years ago

I modified the zoom function. Can you test this version to confirm if that is what you are seeking? https://sourceforge.net/projects/picview/files/PicView-v1.5.6_win-x64-portable-.NET6-Req%20zoom%20test.zip/download

cannibalox commented 2 years ago

thanks for the update, the new zoom out is working great and I can move the image around, nice job ! would you consider enabling a smaller minimum window size (currently it seems capped at 475x435 px) ? it seems the min viable width could be 438px to accomodate the bottom menu bar, maybe the min-height could be smaller ?

cannibalox commented 2 years ago

unrelated: when launching 1.5.6 test version, it crashed as the folder %localappdata%\PicView_Url_0gpqwawzral45yssvrtdapsabx4xgapl\1.5.6.0 was not automatically created, maybe a rights issue ? I had to manually create the folder and populate a recent.txt to avoid crashes when opening pictures

would you prefer that I create another GH issue to track the issue and fr ?

Ruben2776 commented 2 years ago

Sure, I'll take a look at it. New issues would be great.

Ruben2776 commented 2 years ago

This one will fix open last file https://sourceforge.net/projects/picview/files/PicView-v1.5.6_win-x64-portable-.NET6-Req%20zoom%2Clastfile%2Csvg-bg%20fix.zip/download

cannibalox commented 2 years ago

thank you ! closing :)