Change filename to varname algorithm, add try/catch blocks around image processing thread #1419
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The main focus of this PR is to change the filename to varname conversion. I encountered a situation where the entire filename was UTF8, and conversion failed completely, creating a varname of
_svg
. Part os this was due towxString::Format
, but even fixing that resulted in tripling the varname instead of the expected doubling. The new algorithm solves makes the varname a bit shorter, and also solves the UTF8 issue. The name is unique, but for UTF8, it will off course bear no resemblance to the original filename.The second part of this PR adds try/catch around
thrd_collect_img_headers.join();
-- I'm running into a crash in the thread. This won't solve the crash, but should help to find the source of the problem. Once found, it still makes sense to leave the try/catch in place since it won't have any noticeable effect on performance.