mafa/imageaspect 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

mafa/imageaspect

最新稳定版本:0.1.2

Composer 安装命令:

composer require mafa/imageaspect

包简介

ImageAspect - A simple Image Aspect crop coordination generator.

README 文档

README

ImageAspect - A simple Image Aspect Ratio crop coordination generator.

Install

Composer

composer require mafa/imageaspect

Quick Example

$imageAspect = new \MAfa\ImageAspect\ImageAspect(800, 440);
$coordinates = $imageAspect->aspect(2, 1)->generateCoordinates();

// Response is a ImageAspectModel object
MAfa\ImageAspect\ImageAspectModel {
  -width: 800
  -height: 400
  -x: 0
  -y: 0
}

// x is integer to crop from left of image
$coordinates->getX();

// y is integer to crop from top of image
$coordinates->getY();

// width is integer to crop to right of image and width of final width in expected aspect ratio
$coordinates->getWidth();

// height is integer to crop to bottom of image and width of final height in expected aspect ratio
$coordinates->getHeight();

ImageAspectModel object

Method Value Type
getWidth() Width of Image in expected Aspect ratio integer
getHeight() Height of Image in expected Aspect ratio integer
getX() Start area from left of image to crop integer
getY() Start area from top of image to crop integer

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-12-27