stackTom / FSEarthTiles

14 stars 2 forks source link

Unhandled Exception: System.ArgumentException: Parameter is not valid. #18

Open peter-a320 opened 9 months ago

peter-a320 commented 9 months ago

Hello, Just installaed FSEarthTiles 2.0.6 (but also tried with 2.0.5, 2.0.4, 2.0.3, ...). Used resampleFSXSP2.exe from this site, but also from the SDK folder. Tried under Windows 10, with P3Dv5, but also with P3Dv4. Always getting following error message:

Unhandled Exception: System.ArgumentException: Parameter is not valid. at System.Drawing.Bitmap..ctor(String filename) at FSEarthTilesDLL.FSEarthTilesForm.RunMasksAndSceneryCompiler(MasksResampleWorker w) in G:\FSEarthTiles\FSEarthTiles\FSEarthTilesDLL\FSEarthTilesForm.cs:line 2473 at FSEarthTilesDLL.MultiThreadedQueue.OnHandlerStart() in G:\FSEarthTiles\FSEarthTiles\FSEarthTilesDLL\MultiThreadedQueue.cs:line 147 at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart()

and a popup window with the laconic message:

Microsoft .NET Framework Unhandled exception has occurred... Overflow error .............. Details System.OverflowException: Overflow error at System.Drawing.Graphics.CheckErrorStatus(Int32 status) at System.Drawing.Graphics.FillPolygon(Brush...

I verified we are running with .NET Framework 4.8

Also tried with all options OFF (NO), specially the Scenproc option (running v3.2.0, but also tried with other versions) because scenproc gives: Downloading OSM coast and inland water data. As well as computing water polygons from this data; this can take a while, wait Downloading OSM data using server: http://overpass-api.de/api/interpreter. This might take a while. Please wait... ?data=(way["natural"="coastline"](26, -81, 27, -80););(.;>>;);out body; Downloading OSM data using server: http://overpass-api.de/api/interpreter. This might take a while. Please wait... ?data=(rel["natural"="water"](26, -81, 27, -80);rel["waterway"="riverbank"](26, -81, 27, -80);way["natural"="water"](26, -81, 27,
-80);way["waterway"="riverbank"](26, -81, 27, -80);way["waterway"="dock"](26, -81, 27, -80););(.
;>>;);out body; . . . Download failed using https://overpass-api.de/api/map?bbox=... trying new overpass server in 32 seconds ...

but this is independent of the reporting "Overflow error".

FS Earth Tiles 1.03 works without problems, but of course we are interested in the Scenproc option from V2 (for the .agn files).

Your assistance/help/comments/suggestions would be very much appreciated. Thank you beforehand for the support. Regards, Peter

stackTom commented 9 months ago

Please try this build (not released yet) which fixes a similar crash: https://github.com/stackTom/FSEarthTiles/files/12571006/FSET.zip

Might be related to this issue: https://github.com/stackTom/FSEarthTiles/issues/17

If that's the case, I will release it if it works for you.

peter-a320 commented 9 months ago

Thank you so much for the very fast response. I tried with this FSET release (#17), just added "resampleFSXSP2.exe" to the folder and updated the .ini file with the location of the scenproc.exe. Unfortunately it still gives the error:

Download failed using https://overpass-api.de/api/map?bbox=... trying new overpass server in 32 seconds Unhandled Exception: System.ArgumentException: Parameter is not valid. at System.Drawing.Bitmap..ctor(String filename) at FSEarthTilesDLL.FSEarthTilesForm.RunMasksAndSceneryCompiler(MasksResampleWorker w) in G:\FSEarthTiles\FSEarthTiles\FSEarthTilesDLL\FSEarthTilesForm.cs:line 2473

:-(

stackTom commented 9 months ago

Is your computer set to another language that's not English? Try setting it to English. There's a bug where other languages/locales cause a crash. See here: https://github.com/stackTom/FSEarthTiles/issues/9

peter-a320 commented 9 months ago

Thank you for your reply. Interesting. As a matter of fact I have additional languages installed, although the main language is US English. But I have changed the locales...
I will test tonight and report back.
In any case thank you for your time and for making all these valid suggestions. Great support ! :-)

peter-a320 commented 9 months ago

Hello again. The good news is that this problem is definetely related to the "locale". Contrary to the US English, in most European countries is the decimal symbol inverted to the one in the USA. In one PC we changed the LOCALE, "decimal symbol" and "digit grouping symbol" from . , (period comma) to , . (comma period) and the problem got solved. No more OVERFLOW errors. Thank you VERY MUCH for your suggestion. Now we understand the cause of the problem.

However in the production PC, the same changes (LOCALE) did not solve the problem. In this PC there are additional languages installed, but the US English is the default language. At this point I do not understand how this can have influence on the reported problem.
Uninstalling the additional languages is not an option. :-( We need to investigate more. In the mean time any additional suggestion from you would be very welcome.

peter-a320 commented 9 months ago

Again interesting. There are two (mixed) reported problems here. 1- the one where the LOCALE is not a decimal point. This gives the following error: "Value was either too large or too small for a Decimal" 2- the second one that is produced even when the LOCALE is correctly set (as in our case): "System.OverflowException: Overflow error"

The second problem seems related to either the size of the disk or the location as dictated by the .ini file : WorkingFolder = and SceneryFolder = Why does this happen it is still a mystery. Deleting the folders in question seem to correct the error... :-o

So the problem is NOT related to the installation of additional languages. In any case our issue is now solved. :-) Thank you.

stackTom commented 9 months ago

Glad it's working. Thanks for your testing; it gives me information so I can try to troubleshoot this in the future.