mean-cj / fastimage
Laravel Fastimage 辅助库,灵感来自 tommoor
dev-master
2014-01-09 17:08 UTC
Requires
- php: >=5.1
- lib-curl: *
This package is not auto-updated.
Last update: 2024-09-24 07:42:29 UTC
README
FastImage 通过获取尽可能少的资源,根据 Stephen Sykes 的优秀 Ruby 实现(https://github.com/sdsykes/fastimage),根据给定的 URI 查找远程图像文件的尺寸或文件类型。
由 https://github.com/tommoor/fastimage 制作
使用方法
<?php require 'Fastimage.php'; $uri = "http://farm9.staticflickr.com/8151/7357346052_54b8944f23_b.jpg"; // loading image into constructor $image = new FastImage($uri); list($width, $height) = $image->getSize(); echo "dimensions: " . $width . "x" . $height; // or, create an instance and use the 'load' method $image = new FastImage(); $image->load($uri); $type $image->getType(); echo "filetype: " . $type;
参考
- 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/
许可协议
FastImage 在 MIT 许可证下发布。它简单易懂,对您使用该软件的限制几乎为零。 更多信息
下载
可以从 GitHub 下载版本。