Somthing wrong with file save

                    img_for_gray_detection.save(crashpath+crash_name+str(crash_i)+".jpg")

code is like above
some picture can’t saved,and some picture was saved in half.

what wrong?

This looks like some type of bug. A 0KB file is a file save issue. FATFS is pretty well debugged though… was there a system crash then?

As for the line in half of the image. That looks like JPEG corruption. How are the JPEG images created?

code like this:

img_for_gray_detection = sensor.snapshot()
...
...
img_for_gray_detection.draw_string(0,0,timestring,color=color_red,scale=5)

img_for_gray_detection.draw_string(0,50,"M"+str(mean_t)+"T"+str(gray_ok_t),color=color_red,scale=5)

img_for_gray_detection.save(okpath+OK_name+str(finding_i)+".jpg")

Okay, which camera is this, firmware version, and can you give me a script that reproduces the error quickly?

1 Like