littlegiant/silverstripe-cms-image-dimensions

There is no license information available for the latest version (3.2.1) of this package.

Installs: 1 681

Dependents: 0

Suggesters: 0

Security: 0

Stars: 4

Watchers: 4

Forks: 1

Type:silverstripe-vendormodule

3.2.1 2018-09-27 22:54 UTC

This package is auto-updated.

Last update: 2024-12-10 09:47:15 UTC


README

Easily add image dimensions to image fields and enforce maximum sizes for uploads to those fields through configuration.

Provides a single source of image dimensions for the user in the CMS

CMS Image Dimensions CMS Image Dimensions on object

Installation

Installation via composer

$ composer require littlegiant/silverstripe-cms-image-dimensions

Usage

Set definitions in a yml config and add that configuration to the images which you want it to apply to

LittleGiant\CmsImageDimensions\ImageDimensionsProvider:
  max_size: 512K
  definitions:
    blog-post-featured-image:
      name: Blog Post Featured Image
      description: Featured image on your blog post.
      min_width: 1024
      min_height: 768
      validate_dimensions: true
      aspect_ratio: 4:3
      validate_aspect_ratio: true
      max_size: 1M # override default of 512KB to allow larger images

SilverStripe\Blog\Model\BlogPost:
  image_dimensions:
    FeaturedImage: blog-post-featured-image

Contributing

Code guidelines

This project follows the standards defined in: