something I do, is to use a Java-Applet that rescales the users images on the client side. pros: * rescaling is done on the client side: so you only transfer the smaller rescaled version * but if you also want thumbnails you have to compute them on the server again * the applet offers convenient functions to choose/display the images * the user can even rotate the pics before uploading * or drag/drop the files from the windows-explorer to the applet cons: * if java is deactivated or not present, you have to offer a plain html upload as alternative * the you need the resize logic on the server anyway * rescaling is done on the client side: this also means that the client has to do more work - needs memory and cpu * GWT-to-Applet communication is everything but easy * you should sign the applet to get rid of security warnings
http://jupload.sourceforge.net/applet-basic-picture.html this is open source, so you could browse it to see how they rescale your pic other alternative would be to use e.g. flash On Aug 25, 4:47 pm, Manuel Carrasco Moñino <[email protected]> wrote: > This is a simple example to resize and change the format of an image in the > server side. > I hope it helps you > > Manolo Carrasco > > import java.awt.Graphics; > import java.awt.Image; > import java.awt.image.BufferedImage; > import java.io.File; > import java.io.IOException; > > import javax.imageio.ImageIO; > import javax.swing.ImageIcon; > > public class ImageManipulator { > public static void main(String[] args) throws IOException { > transform("image.jpg", "image.png", 100, 100, "png"); > } > > public static void transform(String fileOrig, String fileFinal, int width, > int height, String format) throws IOException { > > File file = new File(fileOrig); > BufferedImage buffImgOrig = ImageIO.read(file); > > ImageIcon thumb = new ImageIcon(buffImgOrig.getScaledInstance(width, > height, Image.SCALE_SMOOTH)); > BufferedImage buffImgFinal = new BufferedImage(thumb.getIconWidth(), > thumb.getIconHeight(), BufferedImage.TYPE_INT_RGB); > Graphics g = buffImgFinal.getGraphics(); > g.drawImage(thumb.getImage(), 0, 0, null); > > File outputfile = new File(fileFinal); > ImageIO.write(buffImgFinal, format, outputfile); > > } > > } > > 2009/8/25 (श्री) GNU Yoga <[email protected]> > > > > > hi > > > On Aug 25, 1:22 pm, Zé Vicente <[email protected]> wrote: > > > Hello all, > > > > This question is not 100% GWT oriented, but I need your help and > > > experience regarding photo album applications. > > > perhaps u can try smartgwt it a gwt wrapper around smartclient js > > libraries > > > Its takes a while (around 2-10 sec based on your connection) to load > > the initial js libraries, but once loaded its quiet faster > > >http://www.smartclient.com/smartgwt/showcase/#featured_tile_filtering > > > - sree > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" 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/google-web-toolkit?hl=en -~----------~----~----~----~------~----~------~--~---
