Images

Image Setup

Brightspot includes a wide variety of image editing capabilities, including cropping, brightness, sharpness and color adjustment, image rotation, blurring, and text overlays.

To begin using and editing images in Brightspot, define a storage mechanism.

Configuring Storage

You configure storage locations for images (and any other binary file) in the Tomcat context.xml file. For information about the various configuration scenarios, see Configuring StorageItem.

Choosing an Image Editor

Brightspot offers two image editors, Java Image Editor for testing and DIMS Image Editor for production. Configure an image editor in the Tomcat context.xml file. See Image Editor Configuration for more information.

An Image object with StorageItem and renderer must be created to begin using images. See Image Object Model for more information.

Image Object Model

To begin using and editing images in Brightspot, the Image object needs to be created by creating an Image.java class with a StorageItem as the file to be uploaded to the default storage mechanism:

public class Image extends Content {

    private String name;
    private StorageItem file;
    private String altText;

    // Getters and Setters
}

Once the Image object is in place, you can begin to work with image content in Brightspot. Several functionalities can be added to image content by adding annotations.

Preview

To allow an image to be previewed in Brightspot but not, as by default, in the text field, add the following annotation to the Image class.

@PreviewField("file")
public class Image extends Content {

    private String name;
    private StorageItem file;
    private String altText;

    //Getters and Setters
}

The system will use the StorageItem field as a preview.

Adding to Rich Text

You can reference Images in the Rich Text Editor and add them as Enhancements to your content. To enable an image for reference, add the following annotation:

@ToolUi.Referenceable
public class Image extends Content {

    private String name;
    private StorageItem file;
    private String altText;

    //Getters and Setters
}

Bulk Upload

Brightspot’s bulk upload feature, located on the Dashboard, allows you to upload multiple files simultaneously. To upload images and automatically populate any required fields, add the following as a beforeSave to automatically use the original file name as the image name.

@Override
public void beforeSave() {
    if (StringUtils.isBlank(name)) {
        if (file != null) {
            Map<string, object=""> metadata = file.getMetadata();
            if (!ObjectUtils.isBlank(metadata)) {
                String fileName = (String) metadata.get("originalFilename");
                if (!StringUtils.isEmpty(fileName)) {
                    name = fileName;
                }
            }
        }
    }
}