masokky/quotemaker 问题修复 & 功能扩展

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

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

masokky/quotemaker

Composer 安装命令:

composer require masokky/quotemaker

包简介

Simple library to create quote image

README 文档

README

QuoteMaker is simple library to create quote image

Example Result

Example Result

Installation

composer require masokky/quotemaker

If you won't use composer, click here with the simple installation

Usage

<?php
require "./vendor/autoload.php";
use masokky\QuoteMaker;
try{
  $text = "the cruelest crime is giving false hope without love";
    (new QuoteMaker)
      ->setBackgroundFromUnsplash(["b353e61a07cc0068080258kc0294ks85042f2560d6223366500a2aa30ff28052"],"heart")
      ->quoteText($text)
      ->watermarkText("Mas Okky")
      ->toFile("result.jpg");
}catch(Exception $e){
  echo $e->getMessage();
}

Available Methods

setBackground($path)

  • $path (string) - Location of background image

setBackgroundFromUnsplash($client_id,$keyword)

You can search and use image from unsplash.com
Before use this function, you should create app to get "client_id" for accessing the API
Because there is a limit per hour for each "client_id", so you can add two or more "client_id" to increase the limit

  • $client_id (array) - The access key of unsplash app
  • $keyword (string) - Keyword to search an image, default random

quoteText($text)

  • $text (string) - Set the quote text. Use \n to add line break

setQuoteFont($path)

  • $path (string) - Set the custom quote font*

setQuoteFontSize($size)

  • $size (int) - Set the custom quote font size*

watermarkText($text)

  • $text (string) - Set the watermark text, default null

setWatermarkFont($path)

  • $path (string) - Set the custom watermark font*

setWatermarkFontSize($size)

  • $size (int) - Set the custom watermark font size*

toScreen()

Output the result to the screen

toFile($file)

Save the result to image file

*Default see the example result

Feel free to develop and maintain this library

统计信息

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

GitHub 信息

  • Stars: 22
  • Watchers: 2
  • Forks: 6
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-10-05

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固