metastrip/image
Composer 安装命令:
composer require metastrip/image
包简介
A lightweight PHP library for efficiently removing EXIF, IPTC, and other metadata from images while preserving quality. Supports JPEG, PNG, and GIF formats.
关键字:
README 文档
README
A lightweight PHP library for efficiently removing EXIF, IPTC, and other metadata from images while preserving quality. Supports JPEG, PNG, and GIF formats.
Features
- Efficient metadata removal with zero quality loss
- Supports multiple image formats and metadata types:
- JPEG: EXIF and IPTC markers
- PNG: tEXt, iTXt, and zTXt chunks
- GIF: XMP and Application Extension blocks
- Privacy-focused: removes sensitive information
- Zero external dependencies (PHP GD only)
- Clean, object-oriented architecture
- Comprehensive test coverage
- PSR-12 compliant
Requirements
- PHP 8.0 or higher
- GD extension
Installation
Install via Composer:
composer require metastrip/image
Usage
Basic usage:
use MetaStrip\Image\ImageProcessorFactory; // Create processor instance $processor = ImageProcessorFactory::create(); // Strip metadata from an image $processor->stripExifData('/path/to/image.jpg');
Advanced usage with specific handlers:
use MetaStrip\Image\ImageProcessor; use MetaStrip\Image\ImageHandler\JpegHandler; use MetaStrip\Image\ImageHandler\PngHandler; use MetaStrip\Image\ImageHandler\GifHandler; // Create processor with specific handlers $processor = new ImageProcessor([ IMAGETYPE_JPEG => new JpegHandler(), IMAGETYPE_PNG => new PngHandler(), IMAGETYPE_GIF => new GifHandler(), ]); // Process multiple images $processor->stripExifData('/path/to/image1.jpg'); $processor->stripExifData('/path/to/image2.png'); $processor->stripExifData('/path/to/image3.gif');
Development
Setup
- Clone the repository:
git clone https://github.com/metastrip/image.git
cd image
- Install dependencies:
composer install
Quality Tools
We use three main tools to ensure code quality:
-
PHPUnit - Testing Framework
# Run tests composer test # Generate coverage report composer test:coverage
-
PHP_CodeSniffer - Code Style
# Check coding standards composer cs # Fix coding standards automatically composer cs:fix
-
PHPStan - Static Analysis
# Run static analysis composer stan
Run all checks at once:
composer check
Continuous Integration
Our GitHub Actions workflow automatically runs:
- Tests on PHP 8.0, 8.1, and 8.2
- Code style checks
- Static analysis
- Code coverage reporting
Contributing
Contributions are welcome! Please feel free to submit a Pull Request. By participating in this project, you agree to abide by its terms.
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make your changes
- Run the tests:
composer check - Commit your changes:
git commit -m 'Add feature' - Push to the branch:
git push origin feature-name - Submit a pull request
License
This project is licensed under the MIT License - see the LICENSE file for details.
metastrip/image 适用场景与选型建议
metastrip/image 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 4 次下载、GitHub Stars 达 1, 最近一次更新时间为 2024 年 11 月 21 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「metadata」 「image」 「security」 「exif」 「xmp」 「optimization」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 metastrip/image 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 metastrip/image 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 metastrip/image 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Yii2 LightBox image galary widget uses Lightbox v2.10.0 by Lokesh Dhakar
The Yii2 extension uses jQuery jquery.carousel-1.1.min.js and makes image carousel from php array of structure defined.
Provide a way to secure accesses to all routes of an symfony application.
It's a barebone security class written on PHP
The Yii2 extension uses jQuery PrettyPhoto and OwlCarousel js and makes image galary from php array of structure defined.
Yii2 Component to manage SEO data and metadata
统计信息
- 总下载量: 4
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 31
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-11-21