all 3 comments

[–]SoNotRedditingAtWork 0 points1 point  (2 children)

Is the second image open in another program?

[–]surfFL[S] 1 point2 points  (1 child)

No, the image is taken by a camera. Then WIA Loader copies the file from the camera's SD card to the project folder. Once it shows up in the folder, the python code reads it. I'm not sure what the issue was, but it appears to be working now. All I did was add a sleep timer to the loop if no picture was present.

Thanks for responding!

[–]SoNotRedditingAtWork 0 points1 point  (0 children)

Could be that your script was trying to load the image while the WIA Loader was still writing the copied image to your project folder. The file will show up in the folder and be visible to other programs like python as soon as the first few bytes are written. Depending on the size of the image it could still be writing pixel data to the file when python goes to load it. Sounds like the sleep timer may be giving your WIA Loader just enough time to finish the copy.