coyotito/image-resizer
Composer 安装命令:
composer require coyotito/image-resizer
包简介
Image resize plugin for NativePHP Mobile (iOS ImageIO + Android Bitmap).
README 文档
README
NativePHP Mobile plugin that downscales images using native APIs — ImageIO on iOS and BitmapFactory on Android.
Install
composer require coyotito/image-resizer
Register the plugin it the NativeServiceProvider:
public function plugins(): array { return [ \Coyotito\ImageResizer\ImageResizerServiceProvider::class, ]; }
Usage
use Coyotito\ImageResizer\Facades\ImageResizer; $ok = ImageResizer::resize( sourcePath: '/abs/path/to/source.jpg', targetPath: '/abs/path/to/target.jpg', maxSide: 1024, // longest side cap; preserves aspect ratio, no upscale quality: 80, // JPEG quality, 0-100 );
Returns true on success, false otherwise. Target is always written as JPEG. EXIF orientation is respected on both platforms.
Platform notes
| Feature | iOS | Android |
|---|---|---|
| Decoder | CGImageSource (ImageIO) |
BitmapFactory with inSampleSize |
| EXIF orientation | Auto via thumbnail transform | Explicit via ExifInterface |
| Output format | JPEG | JPEG |
| Memory efficiency | Thumbnail API streams from disk | inSampleSize downsamples on read |
统计信息
- 总下载量: 6
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-05-26