Infinity Loop with Capture ** Screenshot
when using {{index}}
(escaped) while file exists
#1882
Labels
Capture ** Screenshot
when using {{index}}
(escaped) while file exists
#1882
The following atest should be updated to this, so that the screenshot is taken twice.
The problem is, that the code of
_get_screenshot_path()
does increment the index and then checks if either the (original)filename
is equal to theformatted
filename, which would mean that there was no{index}
in it, or the file does not exists.So that mean if the filename is before and after formatting the same, it does not matter if it exists, it will be overwritten.
BUT there is one special feature, that you can include
{index}
in the final file name, by doubling the braces.So
filename-{{index}}.png
will befilename-{index}.png
in the filesystem.The problem now is, that the original filename (
filename-{{index}}.png
) is not equal with the formatted filenamefilename-{index}.png
and therefore the index is increased. But there is no replaceable index in the original name, so the while loop is infinit.The fix would be to compare not the original with the formatted, but two formatted with different
index
numbers with each other.This is the fixed code:
kind regards
René
The text was updated successfully, but these errors were encountered: