View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0004488||The Dark Mod||GUI||public||05.03.2017 14:20||03.12.2020 19:03|
|Product Version||TDM 2.05|
|Fixed in Version||TDM 2.09|
|Summary||0004488: Image previews are sometimes black|
|Description||Some missions shots are completely black.|
Checking the console shows that it can't load previewshot_gatehouse_2014-01-29_19.24
Checked the _missionshots folder and the name is:
The filename parsing is completing on the first period.
|Steps To Reproduce||Open TDM|
Click "More..." button
Screenshots show black.
Check console shows
WARNING: Couldn't load image: fms/_missionshots/previewshot_gatehouse_2014-01-29_19.24
|Additional Information||The ideal fix would be a code change in filename parser, as this might affect other parts of the engine elsewhere.|
Otherwise, all screenshots that were uploaded to mission database would have to be downloaded, renamed, re-uploaded.
|Tags||No tags attached.|
screenshot.png (1,423,133 bytes)
See screenshot.png for some idea of what is happening. The images are downloading from the server correctly, but not being rendered properly. Going to check some other missions where the images load correctly and see if there is any difference with what is downloaded.
Full Moon Fever works correctly, and it saves the image to same location (__missionscreenshot.temp). So it is something happening between downloading the temp page and displaying it on the GUI
Also I have a really bad keyboard which doesn't let me open the console (even with rebound keys in the config file... New one should arrive on Monday and will help debugging)
|Got the console working with this new keyboard, wish the warning message would tell me which file it was from. But I will look at this again today|
Starts off with the stack of where FAILED TO LOAD IMAGE is called from
Currently debugging the Script_Set function, but not easy
Screenshot 2 shows the image failing to load when the extension is forced on it
Screenshot 3 shows the image failing to load when the absolute path and extension are forced on it.
Maybe it's something inside R_LoadImageProgram not liking all the periods in the filename
screenshot2.png (1,158,436 bytes)
screenshot3.png (420,665 bytes)
Screenshot 4 shows where the lexer is reading the filename incorrectly! We are getting there!
Screenshot 5 shows it reading correctly (from Exhumed FM)
R_ParseImageProgram_r calls idLexer::ReadToken twice when 'More' is pressed for The Gatehouse
Works correctly the first pass
Works incorrectly the second pass
src.buffer (\n replaced by actual newlines to increase readability)
material fms/_missionshots/previewshot_gatehouse_2014-01-29_19.24.32859 // IMPLICITLY GENERATED
The difference is the quotes around the filename in the one that fails
ReadName is being called for the first one
ReadString is being called for the one wrapped in quotes
May have gotten ReadName and ReadString the wrong way around.
I have added LEXFL_ONLYSTRINGS to R_LoadImageProgram as the filename has hyphens in. This nearly solves the problem, but it's still having trouble with the extension
|The think the next problem is DefaultFileExtension in R_LoadImage due to the periods in the files|
I DID IT!!!
Going to clean up code and send patch
This took way longer than expected
Fix is slightly hacky though
FIXED.png (2,081,048 bytes)
|I sent him a PM on the forums, hopefully he sees it.|
|So we're waiting for AlexDiru to provide us his 4-month-old 'slightly hacky' patch to fix this problem?|
|I will look at this problem.|
Gatehouse's preview picture filenames have a different format than those for other missions.
I.e. here's a Gatehouse picture:
And here's one from NHAT:
If there's any number of dots before the file extension, it screws up loading the picture.
It looks like the correct fix is to fix the filenames.
This problem will be fixed by changing the names of the preview pictures to remove the extraneous dots.
No point in futzing with low-level TDM code, trying to accommodate the dots.
Indeed, we should not change the common image loading code in the engine.
Too much depends on it, and too many obstacles to make it work with bad names.
Instead, I simply added some code to sanitize screenshot filenames in svn rev 8892.
For example, here is a name of screenshot file saved for Gatehouse:
As you see, all dots and hyphens (and other bad chars) are replaced with underscores.
Followed by minor refactoring in svn rev 8893.
|05.03.2017 14:20||AluminumHaste||New Issue|
|30.07.2017 16:54||AlexDiru||File Added: screenshot.png|
|30.07.2017 16:55||AlexDiru||Note Added: 0009039|
|30.07.2017 16:57||AlexDiru||Note Edited: 0009039||View Revisions|
|30.07.2017 16:58||AlexDiru||Note Edited: 0009039||View Revisions|
|02.08.2017 10:21||AlexDiru||Note Added: 0009040|
|02.08.2017 11:54||AlexDiru||Note Added: 0009041|
|02.08.2017 17:09||AlexDiru||Note Added: 0009042|
|02.08.2017 17:09||AlexDiru||File Added: screenshot2.png|
|02.08.2017 17:10||AlexDiru||File Added: screenshot3.png|
|02.08.2017 17:16||AlexDiru||Note Added: 0009043|
|02.08.2017 17:17||AlexDiru||File Added: screenshot4.png|
|02.08.2017 17:17||AlexDiru||File Added: screenshot5.png|
|02.08.2017 18:20||AlexDiru||Note Added: 0009044|
|02.08.2017 19:13||AlexDiru||Note Added: 0009045|
|02.08.2017 19:18||AlexDiru||Note Added: 0009046|
|02.08.2017 19:27||AlexDiru||Note Added: 0009047|
|02.08.2017 19:28||AlexDiru||File Added: FIXED.png|
|05.10.2017 13:33||nbohr1more||Note Added: 0009397|
|17.10.2017 15:14||nbohr1more||Note Added: 0009509|
|17.10.2017 15:32||AluminumHaste||Note Added: 0009515|
|13.12.2017 15:10||grayman||Note Added: 0009775|
|13.12.2017 15:17||AluminumHaste||Note Added: 0009776|
|13.12.2017 15:38||grayman||Note Added: 0009777|
|14.12.2017 08:24||grayman||Note Added: 0009781|
|14.12.2017 08:24||grayman||Note Edited: 0009781||View Revisions|
|14.12.2017 14:47||grayman||Note Added: 0009782|
|14.12.2017 14:48||grayman||Assigned To||=> grayman|
|14.12.2017 14:48||grayman||Status||new => resolved|
|14.12.2017 14:48||grayman||Resolution||open => no change required|
|14.12.2017 14:48||grayman||Target Version||TDM 2.06 =>|
|26.07.2020 13:45||stgatilov||Note Added: 0012680|
|26.07.2020 13:46||stgatilov||Assigned To||grayman => stgatilov|
|26.07.2020 13:46||stgatilov||Status||resolved => assigned|
|26.07.2020 13:46||stgatilov||Status||assigned => resolved|
|26.07.2020 13:46||stgatilov||Resolution||no change required => fixed|
|26.07.2020 13:46||stgatilov||Fixed in Version||=> TDM 2.09|