mh/imagetastic 问题修复 & 功能扩展

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

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

mh/imagetastic

Composer 安装命令:

composer require mh/imagetastic

包简介

Nifty image library in my toolbox

README 文档

README

This is a very easy toolkit to upload images to google cloud storage including a thumbnail.

Build Status Scrutinizer Quality Score Scrutinizer Code Intelligence

Latest Release MIT License Total Downloads

Developed by Michael Holm

Google Api: https://cloud.google.com/storage/docs/json_api/v1/

<?php

use Imagetastic\Client;

require_once(__DIR__.'/vendor/autoload.php');

// your google cloud project name
$project = 'alien-dispatch-8258';

// original picture you want to upload and create thumbnail
//$imageUrl = '/tmp/my-image-file.jpg';
$imageUrl = 'https://images.pexels.com/photos/974229/pexels-photo-974229.jpeg?auto=compress&cs=tinysrgb&h=800&w=1200';

// dimentions for the thumbnail
$dimentions = [
    'height' => 300,
    'width' => 400,
];

// your client key, can be downloaded from your google cloud console
$client = new Client(__DIR__.'/client.json', $project);

$r = $client->process($imageUrl, $dimentions);
var_dump($r);

The output will be something:

object(stdClass)#2 (7) {
  ["height"]=>
  int(800)
  ["width"]=>
  int(800)
  ["ratio"]=>
  int(1)
  ["done"]=>
  bool(true)
  ["mime"]=>
  string(10) "image/jpeg"
  ["originalPath"]=>
  string(78) "https://storage.googleapis.com/alien-dispatch-8258/original/5c59a48f95d47.jpeg"
  ["thumbPath"]=>
  string(83) "https://storage.googleapis.com/alien-dispatch-8258/thumb_400x300/5c59a48f95d47.jpeg"
}

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-02-05

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固