sapientpro/image-comparator-laravel 问题修复 & 功能扩展

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

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

sapientpro/image-comparator-laravel

最新稳定版本:v1.1.0

Composer 安装命令:

composer require sapientpro/image-comparator-laravel

包简介

Compare images using Laravel

README 文档

README

https://packagist.org/packages/sapientpro/image-comparator-laravel https://packagist.org/packages/sapientpro/image-comparator-laravel https://packagist.org/packages/sapientpro/image-comparator-laravel

This package is a wrapper of Image Comparator package adapted to use with Laravel via Facade. All methods of Image Comparator are available in the Facade. For the method reference visit the wiki

Prerequisites

  • php 8.1 or higher
  • Laravel 8 or higher
  • Gd extension enabled

Installation

You can install the package using Composer: composer require sapientpro/image-comparator-laravel

Usage

You can start using the Image Comparator Facade by including it in your class:

use SapientPro\ImageComparatorLaravel\Facades\Comparator;

$imageHash = Comparator::hashImage('path_to_image.jpg')

By default, the average hashing algorithm is user for hashing and comparing images. If you want to use difference hashing algorithm, you set it with setHashStrategy() function:

use SapientPro\ImageComparatorLaravel\Facades\Comparator;
use SapientPro\ImageComparator\Strategy\DifferenceHashStrategy;

Comparator::setHashStrategy(new DifferenceHashStrategy());

$similarity = Comparator::compare('path_to_image1.jpg', 'path_to_image2.jpg') // will use difference hash algorithm

统计信息

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

GitHub 信息

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

其他信息

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