Re: Photo album

2009-08-25 Thread Lothar Kimmeringer

Zé Vicente schrieb:

 1. The user chooses to upload a photo which its size is 5Mb.
 
 I am sure that 5Mb is to big to display it afterwords.

Not necessarily, you can offer it as special download in
addition to a picture with smaller resolution.

 How can I
 resize it without loosing the quality?

There are a couple of libraries out there allowing to manipulate
images. Java 2D, JAI are pure Java implementations, you can also
use ImageMagick by calling the binaries with Runtime.exec or use
the JNI-wrapper (I stopped that because it was adding complexity
and crashes).

Shrinking pictures still look quite good, even if you do that
automatically. You would have more problems when magnifying them.

 2. Then I need to show thumbnails of this photo.
 
 What should I do? Thumbnails are different photos with smaller size or
 the same photo with different width and height?

You should create smaller pictures, because the result will look
the same on the browser (that would need to do the resizing itself)
and you save a lot of bandwith and loading time.

 I would appreciate if you can give me links regarding this subject or
 any examples.

Just look up the names a was giving above in the search engine
of your choice. The only ressources I have here are books, so
I can't provide you links that you wouldn't find for yourself
with above method.

More questions about that are in my eyes better asked in
comp.lang.java.help or comp.lang.java.programmer


Regards, Lothar

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en
-~--~~~~--~~--~--~---



Re: Photo album

2009-08-25 Thread श्री

hi

On Aug 25, 1:22 pm, Zé Vicente josevicentec...@gmail.com 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 google-web-toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en
-~--~~~~--~~--~--~---



Re: Photo album

2009-08-25 Thread Manuel Carrasco Moñino
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 gnuy...@gmail.com


 hi

 On Aug 25, 1:22 pm, Zé Vicente josevicentec...@gmail.com 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 google-web-toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en
-~--~~~~--~~--~--~---



Re: Photo album

2009-08-25 Thread mars1412

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
manuel.carrasc...@gmail.com 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 gnuy...@gmail.com



  hi

  On Aug 25, 1:22 pm, Zé Vicente josevicentec...@gmail.com 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 google-web-toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en
-~--~~~~--~~--~--~---