承接 hectorprats/php-image-converter 相关项目开发

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

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

hectorprats/php-image-converter

Composer 安装命令:

composer require hectorprats/php-image-converter

包简介

PHP class to convert image formats

README 文档

README

Version 1.2 beta

PHP library to convert between gif, jpeg, png and webp image files.

Usage

Syntax

echo \ImageConverter\convert(string $from , string $to , int $quality);

Example

<?php
include __DIR__ . '/src/php-image-converter.php';

$from = __DIR__ . '/my-image.png';
$to = __DIR__ . '/my-image.webp';

echo \ImageConverter\convert($from, $to);

Quality

The third argument is an optional $quality value. It will differ depending on your image format.

Format Default Min Max Description
gif null null null Quality value not supported
jpeg -1 0 100 Higher means better quality
png -1 0 9 Lower means better quality
webp 80 0 100 Higher means better quality

Notes

If you try to convert to a path that has not been created, it will try to create it automatically.

Requirements

  • PHP 7+
  • GD (active on almost every server by default)

Contributors

Contributing

Please see contributing for details.

Inspiration

Donate

Donate to DevoneraAB if you want.

License

MIT

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-09-26

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固