PhoenixKit.Migrations.Postgres.V210 (phoenix_kit v2.60.2)

Copy Markdown View Source

V210: a rendition says how it crops.

A fixed image rendition is a box: the photo is scaled to fill it and the excess is cropped. Until now the crop was always taken from the center, which cuts off a subject standing at the edge of the photo. crop_mode lets a rendition choose:

  • center (the default, and what every existing rendition keeps): crop around the middle of the photo;
  • focus: crop around the photo's focal point (Storage.FocalPoint: where its subject is), falling back to the center when none is known.

A rendition that keeps proportions is not cropped, so the column does nothing for it. Only focus is part of a rendition's spec hash, so no existing rendition is remade by this migration.

Locks

ALTER TABLE on the (tiny) renditions table; the default is a constant, so no row is rewritten.

Summary

Functions

Rolls V210 back: the column goes, and every rendition crops at the center again.

Functions

down(opts)

Rolls V210 back: the column goes, and every rendition crops at the center again.