What do you mean by "pure java implementation" vs. "optimized native code"?
Chas. Derek Chen-Becker wrote: > Yes, I take back my recommendation for it. I didn't realize just how bad > it was, but here's a good article on it: > > http://today.java.net/pub/a/today/2007/04/03/perils-of-image-getscaledinstance.html > > JAI works well, but adds a dependency. One note on performance: We have > found in our testing that the pure java impl of JAI actually outperforms > the "optimized" native code by quite a bit for most common operations > like scaling, transforms, crops, etc. > > Derek > > On Thu, Apr 16, 2009 at 1:43 PM, Charles F. Munat <[email protected] > <mailto:[email protected]>> wrote: > > > This is very helpful. I'm glad to hear that others are doing this. I > read, however, that getScaledInstance is slow. Probably not a huge issue > since uploaded images will be infrequent... > > Thanks for the help! > > Chas. > > Derek Chen-Becker wrote: > > Jai or just Java2D would work. I use JAI a lot at work (wrote a > > large-scale image rendering and compositing application), so if > you run > > into issues there just ask. JAI can be somewhat heavy if you have > > simple requirements, so you could also just use the > > Image.getScaledInstance method, which is far simpler. For example: > > > > import java.awt.{Image,Tookit} > > > > val imageData : Array[Byte] = ... > > > > val scaled = > > > Toolkit.getDefaultToolkit.createImage(imageData).getScaledUInstace(width, > > height, Image.SCALE_SMOOTH) > > > > The final param controls which algorithm to use for scaling, so > you can > > use several as defined on the java.awt.Image class. > > > > Derek > > > > On Thu, Apr 16, 2009 at 5:59 AM, Alexander Kellett > <[email protected] <mailto:[email protected]> > > <mailto:[email protected] <mailto:[email protected]>>> wrote: > > > > > > i used jai in the past, a quick google let me to > > > > http://www.digitalsanctuary.com/tech-blog/java/how-to-resize-uploaded-images-using-java-better-way.html > > > > On Thu, Apr 16, 2009 at 11:10 AM, Jean-Luc > <[email protected] <mailto:[email protected]> > > <mailto:[email protected] <mailto:[email protected]>>> wrote: > > > Imagemagick is said to be very efficient for image processing. > > > http://www.imagemagick.org/script/api.php#java > > > > > > If you develop with MacOSX, some people had some compile > issues > > with JMagick > > > and have prefered a more direct solution using "exec" : > > > > > > http://www.darcynorman.net/2005/03/15/jai-vs-imagemagick-image-resizing/ > > > > > > Jean-Luc > > > > > > > > > 2009/4/16 Charles F. Munat <[email protected] > <mailto:[email protected]> <mailto:[email protected] <mailto:[email protected]>>> > > >> > > >> The Georgia Association of Editors? That's good to know. > > >> > > >> (Unfortunately, the app is already built and running on > my own > > server > > >> and I have no time to play with GAE right now. But I'm > getting > > more and > > >> more curious about it.) > > >> > > >> It's funny. I would think that lots of people would be > resizing > > uploaded > > >> images in Java, but I've asked this question before and > got nothing. > > >> Ruby/Rails folks do this sort of thing all the time with > RMagick > > (and > > >> half a dozen other tools). What the heck do Java > developers do? > > >> > > >> Thanks, Viktor! > > >> > > >> Chas. > > >> > > >> Viktor Klang wrote: > > >> > > > >> > > > >> > On Thu, Apr 16, 2009 at 7:36 AM, Charles F. Munat > > <[email protected] <mailto:[email protected]> > <mailto:[email protected] <mailto:[email protected]>> > > >> > <mailto:[email protected] <mailto:[email protected]> > <mailto:[email protected] <mailto:[email protected]>>>> wrote: > > >> > > > >> > > > >> > Has anyone here done anything with Lift in which > uploaded > > images are > > >> > resized (or otherwise manipulated) before saving? > If so, > > how did you > > >> > do > > >> > it? Any recommendations for libraries? > > >> > > > >> > > > >> > GAE offers that kind of functionality. > > >> > > > >> > > > >> > > > >> > > > >> > Thanks! > > >> > > > >> > Chas. > > >> > > > >> > > > >> > > > >> > > > >> > > > >> > -- > > >> > Viktor Klang > > >> > Senior Systems Analyst > > >> > > > >> > > > > >> > > >> > > > > > > > > > > > > -- > > > Jean-Luc Canela > > > [email protected] <mailto:[email protected]> > <mailto:[email protected] <mailto:[email protected]>> > > > > > > > > > > > > > > > > > > > > > > > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~----------~----~----~----~------~----~------~--~---
