Horje
python check if image is corrupted Code Example
python check if image is corrupted
from os import listdir
from PIL import Image
    
for filename in listdir('./'):
  if filename.endswith('.png'):
    try:
      img = Image.open('./'+filename) # open the image file
      img.verify() # verify that it is, in fact an image
    except (IOError, SyntaxError) as e:
      print('Bad file:', filename) # print out the names of corrupt files




Python

Related
compare two dictionaries in python Code Example compare two dictionaries in python Code Example
switch columns and rows python Code Example switch columns and rows python Code Example
append string variable with integer python Code Example append string variable with integer python Code Example
matplotlib draw a line between two points Code Example matplotlib draw a line between two points Code Example
tkinter progresse bar color Code Example tkinter progresse bar color Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7