承接 moritz-sauer-13/silverstripe-focuspointcropper 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

moritz-sauer-13/silverstripe-focuspointcropper

Composer 安装命令:

composer require moritz-sauer-13/silverstripe-focuspointcropper

包简介

Even smarter automatic image cropping for SilverStripe

README 文档

README

#This is a fork from https://github.com/restruct/silverstripe-focuspointcropper to Support SS6

FocusPointCropper: (Even) Smarter Image Cropping for SilverStripe

This module bolts an interface to crop an image from within the CMS, on top of Jonom's excellent FocusPoint module. This facilitates setting an initial crop of an image, which will be used as the basis for FocusPoint's smarter cropping.

Set crop & zoom level (drag/scroll) and FocusPoint (click)

Install / Composer

composer require "micschk/silverstripe-focuspointcropper" "dev-master"

Basic usage

When you edit an image in the CMS there should be an extra 'Focus Point + Crop' field. Scroll on the image to zoom, drag the image and (depending on configuration) resize the selection to set the crop area. Click on the subject of the image to set the focus area and save the image.

Config (@TODO: check/update this for SS4/5+)

Config options can be set using the SilverStripe Config API and will be fed directly to the js cropperfield. Options can be set globally or per field instance.

Settable options: https://github.com/fengyuanchen/cropper/blob/v2.3.0/README.md#options

Config example

Currently not working due to the framework not using getCMSFields() anymore... @TODO: find a hook from AssetFormFactory into the record/relation to allow that to update the config (AssetFormFactory::getFormFields(RequestHandler $controller = null, $formName, $context = []))

Restrain the aspect-ratio to be square and set the initial crop to 80% of the image for a specific page in the CMS;

public function getCMSFields(){
	...
	// Set custom config on FocusCropField for this instance
	Config::inst()->update('FocusPointCropField', 'cropconfig', array(
        'aspectRatio' => 1,
        'autoCropArea' => 0.8,
    ));
    ...
}

(the image will need to be saved and published first, for the crop to actually be applied)

Further Usage

Check the original Silverstripe FocusPoint Module

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 4
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2026-06-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固