|
|
@ -18,9 +18,10 @@ def check_dpi(image_filename):
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
exif = OcrdExif(Image.open(image_filename))
|
|
|
|
exif = OcrdExif(Image.open(image_filename))
|
|
|
|
resolution = exif.resolution
|
|
|
|
resolution = exif.resolution
|
|
|
|
|
|
|
|
if resolution == 1:
|
|
|
|
|
|
|
|
raise Exception()
|
|
|
|
if exif.resolutionUnit == 'cm':
|
|
|
|
if exif.resolutionUnit == 'cm':
|
|
|
|
resolution /= 2.54
|
|
|
|
resolution /= 2.54
|
|
|
|
return int(resolution)
|
|
|
|
return int(resolution)
|
|
|
|
except:
|
|
|
|
except:
|
|
|
|
return 230
|
|
|
|
return 230
|
|
|
|
|
|
|
|
|
|
|
|