aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/examples/label_image/main.cc
diff options
context:
space:
mode:
Diffstat (limited to 'tensorflow/examples/label_image/main.cc')
-rw-r--r--tensorflow/examples/label_image/main.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/tensorflow/examples/label_image/main.cc b/tensorflow/examples/label_image/main.cc
index e4cc11dbe0..7faf1cef61 100644
--- a/tensorflow/examples/label_image/main.cc
+++ b/tensorflow/examples/label_image/main.cc
@@ -99,8 +99,10 @@ Status ReadTensorFromImageFile(string file_name, const int input_height,
if (tensorflow::StringPiece(file_name).ends_with(".png")) {
image_reader = DecodePng(root.WithOpName("png_reader"), file_reader,
DecodePng::Channels(wanted_channels));
+ } else if (tensorflow::StringPiece(file_name).ends_with(".gif")) {
+ image_reader = DecodeGif(root.WithOpName("gif_reader"), file_reader);
} else {
- // Assume if it's not a PNG then it must be a JPEG.
+ // Assume if it's neither a PNG nor a GIF then it must be a JPEG.
image_reader = DecodeJpeg(root.WithOpName("jpeg_reader"), file_reader,
DecodeJpeg::Channels(wanted_channels));
}