定制 tv2regionerne/statamic-image-cropper 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

tv2regionerne/statamic-image-cropper

Composer 安装命令:

composer require tv2regionerne/statamic-image-cropper

包简介

Image cropping fieldtype for Statamic

README 文档

README

Packagist Downloads License Supported Statamic version

This addon adds an image cropping fieldtype, for those cases where focal point cropping just isn't enough.

Features

This fieldtype can be found under the "Media" category, and requires you to set Image Source Field and Dimensions.

If you rather want to do it YAML style, this is it:

handle: crops
field:
  type: image_cropper
  display: Crops
  show_details: true
  source: image
  dimensions:
    '16_9': 16/9
    '1_1': 1/1
    freeform: Freeform

How to Install

You can search for this addon in the Tools > Addons section of the Statamic control panel and click install, or run the following command from your project root:

composer require tv2regionerne/statamic-image-cropper

How to Use

After setting up the fieldtype and have chosen an image, you get the option to select a dimension to crop:

Selecting a dimension will trigger the cropping overlay, and once you're happy with your crop you press Save:

In a template you can then use the crop as so:

<img src="{{ glide:image :crop="crops:16_9:crop" }}" />

This line of code means that you're applying a cropping action to your image. The part :crop="crops:16_9:crop" tells the system two main things:

  • crops is a reference (or "handle") to your specific Image Cropper setting. Remember, you should replace crops with whatever name you've given to your Image Cropper field.
  • 16_9 indicates the aspect ratio for the crop. In this case, it's set to 16:9, which is a common widescreen format. You can change this to any other ratio you need for your image.

Enjoy cropping away!

tv2regionerne/statamic-image-cropper 适用场景与选型建议

tv2regionerne/statamic-image-cropper 是一款 基于 Vue 开发的 Composer 扩展包,目前已累计 6.63k 次下载、GitHub Stars 达 10, 最近一次更新时间为 2023 年 03 月 27 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 tv2regionerne/statamic-image-cropper 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 tv2regionerne/statamic-image-cropper 我们能提供哪些服务?
定制开发 / 二次开发

基于 tv2regionerne/statamic-image-cropper 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

  • Stars: 10
  • Watchers: 3
  • Forks: 1
  • 开发语言: Vue

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-03-27