-
Notifications
You must be signed in to change notification settings - Fork 19.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minor change: Added tif and tiff to white_list_formats #9187
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -963,6 +963,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.') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we really need this warning? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IMO yes or we shouldn't accept tiff at all. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok then. The message is missing a space for the period, please fix There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry about that. Fixed. |
||
if fname.lower().endswith('.' + extension): | ||
is_valid = True | ||
break | ||
|
@@ -1094,7 +1097,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 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will warns a tremendous amount times, isn't it?
I would just do a check before returning.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I am pretty sure it won't (I also ran it).
See the docs at http://docs.python.org/2/library/warnings.html:
"Repetitions of a particular warning for the same source location are typically suppressed."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good then!