Sounds like $file is blank or null.
Which leads back to $img_data.
The way it is written, $img_data should have the form [$key] = > $filename
Before line 193, insert your own debug code:
print_r($img_data);
See what that produces, and work backwards from there.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…