# `PhoenixKitAgent.Attachments.Jpeg`
[🔗](https://github.com/BeamLabEU/phoenix_kit_agent/blob/v0.1.0/lib/phoenix_kit_agent/attachments/jpeg.ex#L1)

Takes the metadata out of a JPEG, without decoding or re-encoding it.

A photo carries the make and time of the camera and, often, the place it was
taken (EXIF, in an `APP1` segment), also XMP, IPTC (`APP13`) and comments. A
picture on its way to a model provider is the picture alone. The segments
before the image data are walked and those are dropped; `APP0` (JFIF), `APP14`
(Adobe: how the colours are stored), the tables and the frame stay, and the
image data is copied as it is, so the pixels do not change.

# `strip_metadata`

```elixir
@spec strip_metadata(binary()) :: {:ok, binary()} | {:error, :unreadable}
```

`bytes` without EXIF, XMP, IPTC, the ICC profile and comments. `{:error,
:unreadable}` when they do not start like a JPEG or the segments before the
image do not add up.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
