承接 siaoynli/laravel-images 相关项目开发

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

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

siaoynli/laravel-images

Composer 安装命令:

composer require siaoynli/laravel-images

包简介

laravel compress images package

README 文档

README

install

this package for laravel

composer require siaoynli/laravel-images

add the ServiceProvider to the providers array in config/app.php

Siaoynli\Image\ImageServiceProvider::class,

If you want to use the facade to log messages, add this to your facades in app.php:

  'Image' => Siaoynli\Image\Facades\Image::class,

Copy the package config to your local config with the publish command:

php artisan vendor:publish --provider="Siaoynli\Image\ImageServiceProvider"

Usage

use  Siaoynli\Upload\Facades\Upload;
use  Siaoynli\Image\Facades\Image;

//upload
$info=Upload::do()
... //if upload success

//图片源文件存储在public目录

//使用相对路径
$filename = $info["url"];
Image::file('.'.$filename)->resize(1500)->save();


////使用绝对路径的文件
$filename = public_path($info["url"]);

Image::file($filename)->resize(1500)->save();
//thumb
Image::file($filename)->resize()->water()->save()
//small image
$small=Image::file($filename)->small()
//resize
Image::file($filename)->resize()->save()
//crop center
Image::file($filename)->crop()->save()
//water
Image::file($filename)->water()->save()
Image::file($filename)->water(public_path("/water/logo.png","bottom-right",20,20)->save("",80)

//压缩图片
 Image::file(storage_path("app" . $filename))->resize(1500)->save();


//源文件存储到storage里,打水印和生成小图在 public 目录
     Image::file(storage_path("app".$filename))->crop()->small($small_filename,150);
          Image::file(storage_path("app".$filename))->resize()->water()->save(public_path($filename));

//存储为其他文件
$new_filename=storage_path($filename);
Image::file($filename)->water()->save($new_filename,90)

Result

//upload  result

array:6 [▼
  "state" => "SUCCESS"
  "original_name" => "0eb30f2442a7d9337afbe24aa94bd11373f001b3.jpg"
  "ext" => "jpg"
  "mime" => "image/jpeg"
  "size" => 130759
  "url" => "/uploads/image/2019-07-10/b40383942859e40ee1f1eb3dd889e01d9b68dcb5.jpg"
]

//upload error
[
  "state"=>"error message"
]

// thumb result
"/uploads/image/2019-07-10/b40383942859e40ee1f1eb3dd889e01d9b68dcb5.jpg"

siaoynli/laravel-images 适用场景与选型建议

siaoynli/laravel-images 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 198 次下载、GitHub Stars 达 0, 最近一次更新时间为 2019 年 11 月 19 日, 在 PHP 生态内属于活跃度较高的组件。

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

围绕 siaoynli/laravel-images 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-11-19