Closed lasselauch closed 2 years ago
Interesting, thanks for the report. I'm able to reproduce this issue using lss as well.
Don't think it's a problem with the while loops. Technically, the names of these files make them a sequence as far as pyseq is concerned. Looks like it finds two of them:
>>> seqs = get_sequences(['gettyimages-1364769281-2048x2048.jpg', 'gettyimages-530573048-2048x2048.jpg', 'gettyimages-1127718214-2048x2048.jpg', 'gettyimages-470543560-2048x2048.jpg', 'gettyimages-155374807-2048x2048.jpg', 'gettyimages-1182189546-2048x2048.jpg', 'gettyimages-157742535-2048x2048.jpg'])
>>> len(seqs)
2
The problem seems to be the sequences sizes:
>>> seqs[0].frames()
[1127718214, 1182189546, 1364769281]
and when formatting these sequences it's trying to calculate the missing frames on line 363 which is many (commenting out that line seems to make it work again).
>>> seqs[0].format()
' 3 gettyimages-%d-2048x2048.jpg [1127718214, 1182189546, 1364769281]'
So it seems like the solution here might be to find a smarter way to calculate missing frames in _get_missing (edit: and/or calculating this on demand).
@lasselauch FYI I've got a branch with a potential fix if you want to give it a try:
@rsgalloway Thanks, for the quick fix, that works great indeed!!! 🚀
Great, thanks for testing. I'll get this merged and deployed to pypi shortly.
Made an interesting discovery today: While searching a folder with the following filenames,
pyseq
stops to respond (!) and hangs itself.My guess it's due to the nature of the
while
loop within theget_sequences
andiget_sequences
functions...I was able to reproduce this issue with empty files, so here's a list of the filenames for further testing:
['gettyimages-1364769281-2048x2048.jpg', 'gettyimages-530573048-2048x2048.jpg', 'gettyimages-1127718214-2048x2048.jpg', 'gettyimages-470543560-2048x2048.jpg', 'gettyimages-155374807-2048x2048.jpg', 'gettyimages-1182189546-2048x2048.jpg', 'gettyimages-157742535-2048x2048.jpg']
Cheers, Lasse