-
Notifications
You must be signed in to change notification settings - Fork 2
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
Error parsing string into single #16
Comments
This seems to be a repeat of Issue #11 , which should be fixed already, but possibly not. I haven't been able to test the bugfix personally on a foreign culture machine. Quick technical details: As for the error itself, this is thrown by a function named "TryParseErr_Single" (at the bottom of the program code in main.vb) at line 4762. This function takes a string value as input (expected to be a decimal value encoded within a string), attempts to convert it to a single (decimal type) datatype, and either returns a single value if successful or an error. There are a few calls to this function within the program to attempt converting strings into single values, specifically for FPS handling. As for your specific error, the problematic function call occurs at line 2923 in main.vb, at the beginning of the THP encoding process (in a subroutine aptly named "Encode"). At the beginning of that subroutine, metadata about the original THP file being replaced is fetched and converted from textboxes in the "THP Info" group box within the "THP" tab to their appropriate variable data types, for further processing during the encoding sequence. The textbox info itself is populated from your Thwimp datafile set used (specifically the fileset's FileData.txt). At line 2923, the FPS data is fetched as a string from the "FPS" textbox, and then converted to a single. Looks like it is failing to parse the string as a single decimal type properly, hence the error. Within FileData.txt, the FPS string is expected to be formatted in invariant (EN-US) culture, in the format of ww.dd (dot character for separator, not "," comma), where w = whole part and d = decimal part. See Section 5 Customization of the manual for full details on the format and syntax of the Thwimp datafile set. So there are either 2 things happening here
If it's issue 1, I'll research a proper bugfix and implement it for a fixed build. |
Please send me over a screenshot of both FileData.txt file used within the Thwimp fileset and of the "THP" tab contents after reproducing the bug during encoding, just to verify stuff is loading correctly on your end. |
Finally made the thp video Here's what I've done (hope this fixes issue #15)
And Voila, Thwimp made a thp file without any error(even without admin rights). Thanks again for the detailed description of the problems in both issues. It helped me. |
I just noticed in your Thwimp screenshot that for some reason the FPS datafield within the "THP" tab has the FPS value set in foreign culture (59,94 with a comma), which would explain the Single parse fail error that you got when set in Bulgaria culture. Although the FileData.txt above has the FPS value strings formatted correctly in EN-US culture (ww.dd dot), the FPS textfield is displaying foreign culture. I need to dig back in my code, but I may be storing the FPS value as a single datatype and then converting back to a string somewhere for the FPS textfield, and forgot to enforce the expected EN-US culture in the string conversion. This would totally explain the issue, and I'll need to put in a bugfix to fully fix Issue #11 . Thanks for the bug report; I'll properly fix this within the week or so with a new minor build. |
**Issue #16 bugfixes:** - Fixed issue with FPS textbox in THP Info not displaying culture invariant single string format, further breaking program when processing THP videos on foreign machines - Fixed issues with video start/end frame single strings for THP Viewer/Ripper cropper not using invariant culture for FFMPEG/FFPlay cmdline calls - Fixed issues with FFMPEG calls using the FPS string value not using invariant culture while THP encoding - Fixed issues with the progress bar/application logger not using invariant culture for the progress bar percentage string values - Added appropriate calls to **Single_ToString()** function to fix these issues **Single_ToString function:** - Added new **Single_ToString_Types** enum to support the 3 types of single.ToString() string conversion formats in the program: - Percentage ("P2") - Single ("F2") - Fixed-point (round-tripped audio frames, "G9") - Created global variable **culture** to handle Invariant CultureInfo object throughout program - Created new function **Single_ToString()** to handle proper string conversion of single data **(culture invariant)** **Misc bugfixes:** - Added more parsing validation, with TryParseErr value conversion checking - **Functions** - btnPlay_Click() - THP Viewer - Rip() - THP Ripper - **Parsing changes** - Start/end video frame cropping information (TryParseErr_UShort()) - FPS value (TryParseErr_Single()) - Fixed a typo within function **nudTD_M_ChangeMe()** - For the video cropper within THP Viewer/Ripper section, use TryParseErr_UShort(), **not** TryParseErr_Single() for updating the video frame end value **Enhancements:** - Updated application version string to v1.2.0.1, copyright to ©2021 - For Y2K bugfix in **btnLogSave_Click()** function (log saver), made date format string a constant rather than an immediate value in date.ToString function call
Thwimp_v1201b.zip Attached is Thwimp v1.2.0.1 beta , which should fix this and other lingering invariant culture-related issues. Please try this build while using your normal regional formatting settings (Bulgarian); this should properly fix the "Error parsing string into single" error for the FPS formatting without workarounds. I'll test this on my end tomorrow and verify. Please report back if this build fixes the Single parsing errors; if so, I'll close this issue and push a formal bugfixed release this week :). Summary of bugfixes:
|
Hello, I'm sorry to hear, that your laptop broke, but now I'm happy, that you are back. I've downloaded the latest version(1.2.0.1) and tried to make a new thp clip. Thanks again for the support. |
Awesome! Glad to hear that it fixes the issues. Will mark this issue as Closed and push out the official v1.2.0.1 release tonight. |
Well, the error is as the title says...
This problem occurs when I try to encode a thp file either through the GUI or the CLI.
What I've done to minimize the chance of this error:
-Copied the files in directories without spaces(directly on the root of the drive)
-I've moved all the needed files in the Thwimp directory (only FFmpeg, ffplay, and ffprobe on a subdirectory ff)
but after these actions, I still get this error.
Here's some basic info
OS: Win 10 with set Bulgarian UI language
Settings file:
[Thwimp.ini v1.2.0.0]
THPRoot = D:\wbfs\DATA\files\thp
FFMpegDir = C:\THWIMP\ff
FFplay_wdir = C:\THWIMP\ff
irfanview = C:\THWIMP\i_view32.exe
thpconv = C:\THWIMP\THPConv.exe
dataDir = 0
audio = 1
audio_bgm = 1
log_msgBox = 1
log_Full = 1
The file path selected for encoding is C:\single_top and all files are named like this (single_top_A1_1.mp4) and are the same resolutions/framerates as their original subvideos
There's nothing in the logfile even with the full log turned on, only this is saved:
MsgBox:
title: Error during Encoding!
msg: Error parsing string into Single
icon: DefaultButton1, OkOnly, Critical
Line number: 4762
Thanks in advance.
The text was updated successfully, but these errors were encountered: