How to blur image while downloading? ( Like Facebook does )
Can anyone point me i开发者_JAVA百科n the direction of blurring an image while the rest of it downloads? Its almost as if Facebook is downloading a percentage of the image, then blurs it while the rest is downloading? if that makes sense..? Thanks in advance!
It's most likely because they are using progressive jpegs or similar image formats.
My guess is that you're downloading a progressive JPG (at one time, would have been an interlaced GIF). PNG also supports an interlaced option, if memory serves.
In any case, Facebook itself isn't doing much other than encoding the pictures using the progressive/interlaced format. Your browser takes care of showing the lower resolution version during the download, then showing the sharper version when the download finishes.
精彩评论