承接 eden/image 相关项目开发

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

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

eden/image

Composer 安装命令:

composer require eden/image

包简介

Eden image component.

关键字:

README 文档

README

Build Status

====

Install

composer install eden/image

====

Introduction

Instantiate image in this manner.

$image = eden('image', '/path/to/image.jpg');

Once you are done modifying the image you can save the image to a file or simply echo out the image object like below.

header('Content-Type: image/jpg');
echo $image;

====

API

====

blur

Applies the selective blur filter. Blurs the image

Usage

eden('image', '/path/to/image.jpg')->blur();

Parameters

Returns Eden\Image\Index

====

brightness

Applies the brightness filter. Changes the brightness of the image.

Usage

eden('image', '/path/to/image.jpg')->brightness(*number $level);

Parameters

  • *number $level - The level of brightness

Returns Eden\Image\Index

Example

eden('image', '/path/to/image.jpg')->brightness($level);

====

colorize

Applies the colorize filter. Like greyscale except you can specify the color.

Usage

eden('image', '/path/to/image.jpg')->colorize(*number $red, *number $blue, *number $green, number $alpha);

Parameters

  • *number $red - The 255 value of red to use
  • *number $blue - The 255 value of blue to use
  • *number $green - The 255 value of green to use
  • number $alpha - The level of alpha transparency

Returns Eden\Image\Index

Example

eden('image', '/path/to/image.jpg')->colorize($red, $blue, $green);

====

contrast

Applies the contrast filter. Changes the contrast of the image.

Usage

eden('image', '/path/to/image.jpg')->contrast(*number $level);

Parameters

  • *number $level - The level of contrast

Returns Eden\Image\Index

Example

eden('image', '/path/to/image.jpg')->contrast($level);

====

crop

Crops the image

Usage

eden('image', '/path/to/image.jpg')->crop(int|null $width, int|null $height);

Parameters

  • int|null $width - The width; If null will use the original width
  • int|null $height - The height; If null will use the original height

Returns Eden\Image\Index

Example

eden('image', '/path/to/image.jpg')->crop();

====

edgedetect

Applies the edgedetect filter. Uses edge detection to highlight the edges in the image.

Usage

eden('image', '/path/to/image.jpg')->edgedetect();

Parameters

Returns Eden\Image\Index

====

emboss

Applies the emboss filter. Embosses the image.

Usage

eden('image', '/path/to/image.jpg')->emboss();

Parameters

Returns Eden\Image\Index

====

gaussianBlur

Applies the gaussian blur filter. Blurs the image using the Gaussian method.

Usage

eden('image', '/path/to/image.jpg')->gaussianBlur();

Parameters

Returns Eden\Image\Index

====

getDimensions

Returns the size of the image

Usage

eden('image', '/path/to/image.jpg')->getDimensions();

Parameters

Returns array

====

getResource

Returns the resource for custom editing

Usage

eden('image', '/path/to/image.jpg')->getResource();

Parameters

Returns [RESOURCE]

====

greyscale

Applies the greyscale filter. Converts the image into grayscale.

Usage

eden('image', '/path/to/image.jpg')->greyscale();

Parameters

Returns Eden\Image\Index

====

invert

Inverts the image.

Usage

eden('image', '/path/to/image.jpg')->invert(bool $vertical);

Parameters

  • bool $vertical - If true invert vertical; if false invert horizontal

Returns Eden\Image\Index

Example

eden('image', '/path/to/image.jpg')->invert();

====

meanRemoval

Applies the mean removal filter. Uses mean removal to achieve a "sketchy" effect.

Usage

eden('image', '/path/to/image.jpg')->meanRemoval();

Parameters

Returns Eden\Image\Index

====

negative

Applies the greyscale filter. Reverses all colors of the image.

Usage

eden('image', '/path/to/image.jpg')->negative();

Parameters

Returns Eden\Image\Index

====

resize

Resizes the image. This is a version of scale but keeping it's original aspect ratio

Usage

eden('image', '/path/to/image.jpg')->resize(int|null $width, int|null $height);

Parameters

  • int|null $width - the width; if null will use the original width
  • int|null $height - the height; if null will use the original height

Returns Eden\Image\Index

Example

eden('image', '/path/to/image.jpg')->resize();

====

rotate

Rotates the image.

Usage

eden('image', '/path/to/image.jpg')->rotate(*int $degree, int $background);

Parameters

  • *int $degree - The degree to rotate by
  • int $background - Background color code

Returns Eden\Image\Index

Example

eden('image', '/path/to/image.jpg')->rotate(123);

====

scale

Scales the image. If width or height is set to null a width or height will be auto determined based on the aspect ratio

Usage

eden('image', '/path/to/image.jpg')->scale(int|null $width, int|null $height);

Parameters

  • int|null $width - The width; if null will use the original width
  • int|null $height - The height; if null will use the original height

Returns Eden\Image\Index

Example

eden('image', '/path/to/image.jpg')->scale();

====

setTransparency

Sets the background color to be transparent

Usage

eden('image', '/path/to/image.jpg')->setTransparency();

Parameters

Returns Eden\Image\Index

====

smooth

Applies the smooth filter. Makes the image smoother.

Usage

eden('image', '/path/to/image.jpg')->smooth(*number $level);

Parameters

  • *number $level - The level of smoothness

Returns Eden\Image\Index

Example

eden('image', '/path/to/image.jpg')->smooth($level);

====

save

Saves the image data to a file

Usage

eden('image', '/path/to/image.jpg')->save(*string $path, string|null $type);

Parameters

  • *string $path - The path to save to
  • string|null $type - The render type

Returns Eden\Image\Index

Example

eden('image', '/path/to/image.jpg')->save('foo');

====

#Contributing to Eden

Contributions to Eden are following the Github work flow. Please read up before contributing.

##Setting up your machine with the Eden repository and your fork

  1. Fork the repository
  2. Fire up your local terminal create a new branch from the v4 branch of your fork with a branch name describing what your changes are. Possible branch name types:
    • bugfix
    • feature
    • improvement
  3. Make your changes. Always make sure to sign-off (-s) on all commits made (git commit -s -m "Commit message")

##Making pull requests

  1. Please ensure to run phpunit before making a pull request.
  2. Push your code to your remote forked version.
  3. Go back to your forked version on GitHub and submit a pull request.
  4. An Eden developer will review your code and merge it in when it has been classified as suitable.

eden/image 适用场景与选型建议

eden/image 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 8.53k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2013 年 09 月 24 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「library」 「eden」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

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

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

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-09-24