13 July 2008
Last year I was amazed by the innovation demonstrated by Fluxify, a neat online utility powered by the managed code version of Silverlight. The guys at fluxcapacity ported libjpeg to pure managed code, so the end result is:
The big news: today they posted the source to the FJCore library on Google Code, so anyone else can get involved in the bits as well!
Just to quickly show you how cool and easy this is, here's some C# from the included sample app that does the resizing of a Stream:
using (fileStream) { JpegDecoder decoder = new JpegDecoder(fileStream); DecodedJpeg jpeg = decoder.Decode(); ImageResizer resizer = new ImageResizer(jpeg.Image); FluxJpeg.Core.Image small = resizer.Resize(320, ResamplingFilters.NearestNeighbor); JpegEncoder encoder = new JpegEncoder(small, 90, outStream); encoder.Encode(); BitmapImage image = new BitmapImage(); outStream.Seek(0, SeekOrigin.Begin); image.SetSource(outStream); OutputImage.Source = image; }
That's super easy to use! Check it out. These guys are smart, and it's great that they're sharing their implementation for other folks.
Jeff Wilcox is a Software Engineer at Microsoft in the Open Source Programs Office (OSPO), helping Microsoft engineers use, contribute to and release open source at scale.