MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / FileFormatString

Function FileFormatString

tensorflow/core/kernels/decode_image_op.cc:53–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51}
52
53string FileFormatString(FileFormat magic, StringPiece data) {
54 switch (magic) {
55 case kPngFormat:
56 return "PNG";
57 case kJpgFormat:
58 return "JPEG";
59 case kGifFormat:
60 return "GIF";
61 default: {
62 if (data.empty()) return "empty file";
63 return strings::StrCat("unknown format starting with '",
64 absl::CEscape(data.substr(0, 16)), "'");
65 }
66 }
67}
68
69// Decode an image (either jpeg, png, or gif). We use a single op so that
70// users don't have to care about which format they have.

Callers 1

ComputeMethod · 0.85

Calls 3

CEscapeFunction · 0.85
StrCatFunction · 0.50
emptyMethod · 0.45

Tested by

no test coverage detected