rafiki23/watermarkcredits 问题修复 & 功能扩展

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

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

rafiki23/watermarkcredits

最新稳定版本:0.0.2

Composer 安装命令:

composer require rafiki23/watermarkcredits

包简介

WatermarkCredits is a Laravel package that enables the easy application of watermarks with logo and author information onto images.

README 文档

README

WatermarkCredits is a Laravel package for easily applying watermarks logo and author information on images.

It provides a straightforward interface for applying custom watermarks with adjustable opacity levels and the option to add supplemental text.

This is perfect for photographers, content creators, and businesses looking to protect their work and ensure proper authorship attribution on their images.

Add your logo and author name on image

Installation

Install the package via composer:

composer require rafiki23/watermarkcredits

Add the service provider to your config/app.php file:

'providers' => [
    // Other Service Providers

    Rafiki23\WatermarkCredits\WatermarkServiceProvider::class,
],

Publish the configuration file:

php artisan vendor:publish --provider="Rafiki23\WatermarkCredits\WatermarkServiceProvider" --tag="config"

Configuration

After publishing the configuration file, it is located at config/watermark.php. You can modify it to set your default configurations.

return [
    'opacity' => 0.6, // 60% opacity
    'rectangle_color' => [0, 0, 0, 0.6], // black with 50% opacity
    'text_color' => '#ffffff', // white
    'font_size' => 24, // default font size
    'font_path' => resource_path('fonts/Arial.ttf'), // path to the font file, assuming Arial.ttf is in the "fonts" folder under "resources"
    'font_ratio' => 0.1, // font size as a ratio of image height
    'default_logo_path' => resource_path('img/yourlogo.png'), // Default logo path, if you have a standard logo you want to use
];

Usage

Here's how you can use the WatermarkCredits package:

use Rafiki23\WatermarkCredits\Watermark;

$watermark = new Watermark();

// Apply watermark to an image
$watermark->applyWatermark('path/to/image.jpg', 'Author name')->save('path/to/output/image.jpg');

You can also specify a custom logo:

$watermark->applyWatermark('path/to/image.jpg', 'Author name', 'path/to/your/custom/logo.png')->save('path/to/output/image.jpg');

License

The WatermarkCredits package is open-sourced software licensed under the MIT license.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-12-04