Skip to main content

Module images

Module images 

Source
Expand description

Content-addressed image store: <cache dir>/images/ab/cd/<sha256>.<ext> (files 0600, dirs 0700), indexed in the images table by URL. Several URLs with identical bytes share one file. When the total size of distinct files exceeds [cache] image_max_mb (default 500), the least recently used files are evicted.

Images are fetched without cookies or any session headers, and only from Grab’s CDN hosts (image_url_allowed). Originals are stored as-is: Grab mostly serves AVIF/WebP, which the pure-Rust image crate can’t decode (AVIF) or only encode losslessly (WebP), so there is no thumbnailing; width/height are recorded for PNG/JPEG only.

Structs§

CachedImage
A cached image file.

Functions§

image_url_allowed
Only https:// URLs on grab.com or a subdomain (the CDNs: food-cms.grab.com, huawei-food-cms.grab.com, assets-mobile.grab.com, …), with no credentials or custom port.