mirror of
https://github.com/sdsykes/fastimage.git
synced 2025-08-10 00:01:04 -04:00
Improve documentation
This commit is contained in:
parent
c8a1f44112
commit
a3291e48d6
@ -4,9 +4,11 @@ h4. FastImage finds the size or type of an image given its uri by fetching as li
|
||||
|
||||
h2. The problem
|
||||
|
||||
Your app needs to find the size or type of an image. But the image is not locally stored - it's on another server, or in the cloud - at Amazon S3 for example.
|
||||
Your app needs to find the size or type of an image. This could be for adding width and height attributes to an image tag, for adjusting layouts or overlays to fit an image or any other of dozens of reasons.
|
||||
|
||||
You don't want to download the entire image, which could be many tens of kilobytes, or even megabytes just to get this information. For most image types, the size of the image is simply stored at the start of the file. For JPEG files it's a little bit more complex, but even so you do not need to fetch most of the image to find the size.
|
||||
But the image is not locally stored - it's on another asset server, or in the cloud - at Amazon S3 for example.
|
||||
|
||||
You don't want to download the entire image to your app server - it could be many tens of kilobytes, or even megabytes just to get this information. For most image types, the size of the image is simply stored at the start of the file. For JPEG files it's a little bit more complex, but even so you do not need to fetch most of the image to find the size.
|
||||
|
||||
FastImage does this minimal fetch for image types GIF, JPEG, PNG and BMP.
|
||||
|
||||
@ -35,4 +37,11 @@ h2. Documentation
|
||||
|
||||
"http://rdoc.info/projects/sdsykes/fastimage":http://rdoc.info/projects/sdsykes/fastimage
|
||||
|
||||
(c) 2009 Stephen Sykes (sdsykes)
|
||||
h2. References
|
||||
* "http://pennysmalls.com/2008/08/19/find-jpeg-dimensions-fast-in-ruby/":http://pennysmalls.com/2008/08/19/find-jpeg-dimensions-fast-in-ruby/
|
||||
* "http://snippets.dzone.com/posts/show/805":http://snippets.dzone.com/posts/show/805
|
||||
* "http://www.anttikupila.com/flash/getting-jpg-dimensions-with-as3-without-loading-the-entire-file/":http://www.anttikupila.com/flash/getting-jpg-dimensions-with-as3-without-loading-the-entire-file/
|
||||
* "http://imagesize.rubyforge.org/":http://imagesize.rubyforge.org/
|
||||
|
||||
|
||||
(c) 2009 Stephen Sykes
|
@ -20,6 +20,7 @@
|
||||
# * http://snippets.dzone.com/posts/show/805
|
||||
# * http://www.anttikupila.com/flash/getting-jpg-dimensions-with-as3-without-loading-the-entire-file/
|
||||
# * http://pennysmalls.com/2008/08/19/find-jpeg-dimensions-fast-in-ruby/
|
||||
# * http://imagesize.rubyforge.org/
|
||||
#
|
||||
require 'net/https'
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user