Skip to Content

The default CLI session registers implemented image primitives for JPEG data:

SurfaceStatusPurpose
spql.image.JpegImplementedLazy JPEG handle over a Blob source.
spql.image.JpegBytesImplementedMaterialized encoded JPEG bytes.
spql.image.ExifImplemented, unstableParsed EXIF summary value.
spql.viz.ImageViewImplementedImage preview value backed by a Blob source.
Dataset discovery table functionsExperimentalSee the planned section below.

JPEG Handles

Construct a lazy JPEG handle from a Blob:

SELECT spql.image.jpeg(spql.io.blob('file:///tmp/photo.jpg', mime_type => 'image/jpeg')) AS photo;

spql.image.jpeg(source) expects a spql.io.Blob. It wraps the source and does not read bytes immediately.

JPEG Bytes

Construct materialized JPEG bytes from a binary column:

SELECT spql.image.jpeg_bytes(encoded_jpeg) AS photo_bytes FROM photos;

Read a Blob source as materialized JPEG bytes:

SELECT spql.image.read_jpeg(source_blob) AS photo_bytes FROM photos;

spql.image.read_jpeg is an async scalar function. It validates that the bytes begin with a JPEG SOI marker.

EXIF

Read an EXIF summary from a lazy JPEG handle:

SELECT spql.image.exif(spql.image.jpeg(source_blob)) AS exif FROM photos;

Read EXIF from materialized JPEG bytes:

SELECT spql.image.exif(photo_bytes) AS exif FROM photos;

The current EXIF summary storage contains:

FieldMeaning
byte_lenLength of the EXIF APP1 payload.
camera_makeCamera make when present.
camera_modelCamera model when present.
created_atEXIF original timestamp when present.
orientationEXIF orientation value 1..8 when present.
gps_presentWhether any GPS EXIF fields were present.

For lazy JPEG handles, spql.image.exif rewrites to an internal async prefix read and scans at most the first MiB of the Blob. For JpegBytes, EXIF parsing is synchronous over the materialized bytes.

Preview

The image plugin registers a default visualization coercion from Jpeg to spql.viz.ImageView. Materialized JpegBytes values must be externalized into spql.io.Blob before they can use the Blob-backed ImageView path. The current egui provider renders length-1 ImageView arrays and supports JPEG MIME data.

Planned Dataset Functions

Experimental: Contact Us

This surface is directional and may change before public release. Contact Spiral if you want to use it in an early workflow.

Image dataset discovery table functions are not public runtime APIs yet. The intended shape is:

FunctionPurpose
images.scan(path)Discover images below a local path, object-store prefix, or manifest.
images.manifest(path)Read an explicit manifest with ids, paths, labels, splits, and metadata.
images.decode(image_ref)Materialize image bytes or tensors for a bounded result.
images.thumbnails(image_ref)Produce lightweight preview artifacts.

These names are preview names. The current binder supports positional and named table-function arguments, but these image dataset functions are not registered yet.

Last updated on