PhoenixKitAgent.Attachments.Jpeg (PhoenixKitAgent v0.1.0)

Copy Markdown View Source

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.

Summary

Functions

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.

Functions

strip_metadata(arg1)

@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.