# tf.io.is_jpeg

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.13.1/tensorflow/python/ops/image_ops_impl.py#L3147-L3164) |

Convenience function to check if the 'contents' encodes a JPEG image.

#### View aliases


**Main aliases**

[`tf.image.is_jpeg`](https://www.tensorflow.org/api_docs/python/tf/io/is_jpeg)
**Compat aliases for migration**

See
[Migration guide](https://www.tensorflow.org/guide/migrate) for
more details.

[`tf.compat.v1.image.is_jpeg`](https://www.tensorflow.org/api_docs/python/tf/io/is_jpeg), [`tf.compat.v1.io.is_jpeg`](https://www.tensorflow.org/api_docs/python/tf/io/is_jpeg)

<br />

    tf.io.is_jpeg(
        contents, name=None
    )

<br />

<br />

<br />

| ## Args ||
|---|---|
| `contents` | 0-D `string`. The encoded image bytes. |
| `name` | A name for the operation (optional) |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A scalar boolean tensor indicating if 'contents' may be a JPEG image. is_jpeg is susceptible to false positives. ||

<br />