承接 machinateur/imagickompare 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

machinateur/imagickompare

最新稳定版本:1.0.0

Composer 安装命令:

composer require machinateur/imagickompare

包简介

A little PHP function that can compare PDFs and images using the Imagick PHP extension.

README 文档

README

A little PHP function that can compare PDFs and images using the Imagick PHP extension.

Requirements

  • At least PHP >=7.4 is required
    • Extension ext-imagick is required

Installation

composer require machinateur/imagickompare

Usage

<?php

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

// simply compare two files (pdf, png, etc.)
$diffPercentage = \compare_with_imagick('/path/to/control-file', '/path/to/compare-file');
// or define a resolution
$diffPercentage = \compare_with_imagick('/path/to/control-file', '/path/to/compare-file', [100, 100]);
// and define a fuzziness for diff metrics
$diffPercentage = \compare_with_imagick('/path/to/control-file', '/path/to/compare-file', fuzziness: 5);
// the merged file can be saved as well, when passing an open file handle
$diffPercentage = \compare_with_imagick('/path/to/control-file', '/path/to/compare-file', fh: $fh = \fopen('php://temp'));

Tests

There are no tests for this library as of now.

I have used it in two of my projects (the-printe, php-qpdf-ffi) to assess PDF file differences in their tests.

License

It's MIT.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-10-25