Creating Image Sizes

After a user uploads an image, Brightspot can use it in a variety of sizes depending on the context. For example, in the context of an author’s bio page, the image is typically large; in the context of a byline, the same image is typically small.

The easiest way to instantiate image sizes is in a theme’s configuration file _config.json; for details, see Define Image Sizes. You can also instantiate image sizes using the classes ImageSize and ImageSizeBuilder.

ImageSize imageSize = ImageSize.builder()
    .displayName("Medium Size")
    .internalName("medium-size")
    .width(100)
    .height(200)
    .build();

See also: