ibnux/generic-book-cover 问题修复 & 功能扩展

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

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

ibnux/generic-book-cover

Composer 安装命令:

composer require ibnux/generic-book-cover

包简介

PHP package to generate generic book covers for books where no original cover is available.

README 文档

README

This is a small package for generating generic book covers that can be used with online book displays, etc. in cases where no original cover is available.

The cover elements (title, subtitle, creators, etc.) will be sized, adjusted and possibly wrapped automatically. This works quite well in most cases, but the result will certainly not be visually/typographically pleasant in all cases. The package doesn't currently provide any options for manually adjusting the arrangement of cover elements.

The package is based on a script by @kyrretl.

Installation

Install using Composer:

composer require ibnux/covergenerator dev-master

The package requires ImageMagick and Ghostscript.

Usage example

require('vendor/autoload.php');
use ibnux\GenericBookCover\BookCover;

$cover = new BookCover();
$cover->setTitle('Manual of scientific illustration')
	->setSubtitle('with special chapters on photography, cover design and book manufacturing')
	->setCreators('Charles S. Papp')
	->setEdition('3rd enl. ed.')
	->setPublisher('American Visual Aid Books')
	->setDatePublished('1976')
	->setRandomBackgroundColor()
	->save('cover1.png');

Instead of saving the cover to a file, you can also get the image data and serve it directly:

header('Content-Type: image/png');
echo $cover->getImageBlob();

Example covers

See examples/examples.php for the source code for the example covers.

Cover 1 Cover 2 Cover 3 Cover 4

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-10-23