定制 drezynsoft/split-image 二次开发

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

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

drezynsoft/split-image

Composer 安装命令:

composer require drezynsoft/split-image

包简介

Split PNG images into pieces.

README 文档

README

Split Image is a tool written in PHP to split images in format of PNG to smaller pieces. What is more valuable it could be used to split images with repetition of the left/right top/bottom fragments to get atlas form of presentation.

Installation

composer require drezynsoft/split-image

or simply download the package in zip format.

Configuration

You can use the config/config.php file or just override default options with args in console.

config/config.php options

Params obliged:

After split command: source-file

Path to PNG file to split.

After source-file: destination-dir (second after split command)

Path to directory where split files will be saved.

Note: Minimal command is as follows (warning: last slash is required):

$ split-image split path/to/png/file.png path/to/save-dir/

Note: Trailing slash in directory path is necessary.

List of other available params:

--width default: 2200 (int)

Destination width [px] of the every split image.

--height default: 3300 (int)

Destination height [px] of the every split image.

--left-right-margin default: 500 (int)

Margin of the previous (if any) split image. It is the simply floating coat of the previous split image (in width) [px].

--top-bottom-margin default: 500 (int)

Margin of the previous (if any) split image. It is the simply floating coat of the previous split image (in height) [px].

--sep default: '_' (string)

Text between digits of rows count and cols count.

--prefix default: '' (string)

Text before digits of rows and cols.

--suffix default: '' (string)

Text after digits of rows and cols.

--RAM-factor default: 3.0 (float)

Multiplier for calculating predicted RAM usage.

--compression default: 0 max: 9 (int)

Compression of PNG file 0-9.

Note: All params starting with -- are optional and could be given in any order. Also all of them can be used in config/config.php without the -- prefix.

List of params outside of the console:

default-file default: 'data/to_convert/DrezynSoft.png' (string)

Source file.

default-dir default: 'data/converted/' (string)

Destination directory.

Usage

Simplest usage (with defaults)

By console

$ vendor/bin/split-image split path/to/png/file.png path/to/save-dir/

or without composer

$ scripts/split-image split path/to/png/file.png path/to/save-dir/

Note: Trailing slash in directory path is necessary.

Tip: When params in config/config.php are the same you would like to use, you don't have to pass them into console command. The params will be get from config file.

By http

go to: http://example.com/split-image/

Note: With assumption that tool is installed in split-image dir in public of the site.

Recommendation: When you use huge files it can take long to split so end of script execution could interrupt the process.

Note: There is no possible to change defaults options. You can only edit the config/config.php and then open the http page.

Issues

The tool has been made for one reason at one moment so we really can not to predict new version of this program.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Custom
  • 更新时间: 2016-07-26

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固