|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Too many users try to decode pngs as jpegs. Now, if you pass a png to
decode_jpeg, or a gif to decode_png, it silently does what the user was
expecting.
Unfortunately, tf.image.decode_image still exists as a separate thing in
Python, since decode_gif returns 4-D shapes incompatible with the other ops. A
future CL could clean that up, but it's hard to do in a backwards compatible
way. As is, decode_png and decode_jpeg will bail if you try to decode an
animated gif, and produce 3-D images for nonanimated gifs.
Also fix some crash-on-error bugs and memory leak bugs in gif_io.cc.
RELNOTES: Make decode_jpeg/decode_png/decode_gif handle all formats, since users frequently try to decode an image as the wrong type.
Fixes #9786.
PiperOrigin-RevId: 155888493
|