Skip to content

Commit

Permalink
Minor change: Added tif and tiff to white_list_formats (keras-team#9187)
Browse files Browse the repository at this point in the history
* Minor change: Added tif and tiff to white_list_formats

* UserWarning message for tiff images added

* Space between sentences added
  • Loading branch information
MiliasV authored and fchollet committed Jan 27, 2018
1 parent f51a7ef commit 83ae7d6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion keras/preprocessing/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -962,6 +962,9 @@ def _recursive_list(subpath):
for fname in files:
is_valid = False
for extension in white_list_formats:
if fname.lower().endswith('.tiff'):
warnings.warn('Using \'.tiff\' files with multiple bands will cause distortion. '
'Please verify your output.')
if fname.lower().endswith('.' + extension):
is_valid = True
break
Expand Down Expand Up @@ -1093,7 +1096,7 @@ def __init__(self, directory, image_data_generator,
self.save_format = save_format
self.interpolation = interpolation

white_list_formats = {'png', 'jpg', 'jpeg', 'bmp', 'ppm'}
white_list_formats = {'png', 'jpg', 'jpeg', 'bmp', 'ppm', 'tif', 'tiff'}

# first, count the number of samples and classes
self.samples = 0
Expand Down

0 comments on commit 83ae7d6

Please sign in to comment.