nazieb/flashimage
Composer 安装命令:
composer require nazieb/flashimage
包简介
Get the type & size information of an image by fetching as little as possible
README 文档
README
Get the type & size information of an image by fetching as little as possible.
This project is a fork of Fastimage library by Tom Moor, which itself is a port of Ruby implementation by Stephen Sykes
The main difference with the original library is that this one uses a PSR-7 compatible HTTP adapter to fetch image from the web, thanks to Ivory HTTP library by Eric Geloen
Installation
The recommended way to install FlashImage is by using Composer
To add FlashImage as dependency to your project, add a dependency on nazieb/flashimage to your project's composer.json file.
{
"require": {
"nazieb/flashimage": "~1.0"
}
}
Usage
The main class of the FlashImage is the Flashimage\Factory which will load the image and initialize all the resource needed to fetch the data
$uri = "http://farm9.staticflickr.com/8151/7357346052_54b8944f23_b.jpg"; // loading image into constructor $image = new Flashimage\Factory($uri); list($width, $height) = $image->getSize(); echo "dimensions: " . $width . "x" . $height; // or, create an instance and use the 'load' method $image = new Flashimage\Factory(); $image->load($uri); $type = $image->getType(); echo "filetype: " . $type;
Supported Formats
Currently FlashImage only support 4 types of image: png, jpeg, bmp, gif.
More to come, or if you think you can contribute to support more formats, please send a Pull Request.
References
- https://github.com/tommoor/fastimage
- https://github.com/sdsykes/fastimage
- http://pennysmalls.com/find-jpeg-dimensions-fast-in-pure-ruby-no-ima
- http://snippets.dzone.com/posts/show/805
- http://www.anttikupila.com/flash/getting-jpg-dimensions-with-as3-without-loading-the-entire-file/
- http://imagesize.rubyforge.org/
License
MIT
nazieb/flashimage 适用场景与选型建议
nazieb/flashimage 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 17 次下载、GitHub Stars 达 0, 最近一次更新时间为 2015 年 09 月 26 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「fastimage」 「image size」 「ruby port」 「flashimage」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 nazieb/flashimage 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 nazieb/flashimage 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 nazieb/flashimage 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
FasterImage finds the size or type of a set of images given their uris by fetching as little as needed, in parallel. Originally ported by Tom Moor.
Fastimage
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.
Commonly used constants for PHP
Reading information of images
统计信息
- 总下载量: 17
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 16
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-09-26