littlegiant / silverstripe-cms-image-dimensions

本包最新版本(3.2.1)没有可用的许可证信息。

安装次数: 1,643

依赖: 0

建议者: 0

安全: 0

星标: 4

关注者: 4

分支: 1

类型:silverstripe-vendormodule

3.2.1 2018-09-27 22:54 UTC

This package is auto-updated.

Last update: 2024-09-10 09:21:55 UTC


README

轻松将图像尺寸添加到图像字段,并通过配置强制最大上传尺寸。

为用户在CMS中提供一个图像尺寸的单一来源

CMS Image Dimensions CMS Image Dimensions on object

安装

通过composer安装

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

使用方法

在yml配置中设置定义,并将该配置添加到要应用该配置的图像

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

贡献

代码规范

本项目遵循以下标准定义