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.4is required- Extension
ext-imagickis required
- Extension
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
其他信息
- 授权协议: MIT
- 更新时间: 2024-10-25