Solved

applet to resize images on client machine then upload to the server

Posted on 2006-11-12
4
737 Views
Last Modified: 2008-01-09
Hi Experts,

Upload files to server and then resize it, it's easy to achieve. I've done it already by .net.  My boss wants to resize it on client side, and do the multi upload as well, then upload to the server. My boss said  he wanted to save not only bandwith but also improve upload speed for end users He wants to use java applet/flash on the client side, because it's cross browser support. He believes it's achievable, and that's why I'm asking this question. Some experts said it's not achieable by flash. But I found a software written by java applet, which can resize image at client side then upload to the server. Here is the demo website: http://upload.thinfile.com/image/demo.php

Has anyone got any ideas about it?

Regards,
Lijunguo
0
Comment
Question by:lijunguo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 24

Expert Comment

by:sciuriware
ID: 17926442
It's not the applet, it's the code that you use to resize, and that's applicable in any program.

   /**
    * Resizes an Image by stretching it to a new size by x factor and y factor.
    *
    * @param picture the initial image.
    * @param xFactor the width stretching factor.
    * @param yFactor the height stretching factor.
    * @return the stretched image.
    */
   public static Image resize(Image picture, double xFactor, double yFactor)
   {
      BufferedImage buffer;
      Graphics2D g;
      AffineTransform transformer;
      AffineTransformOp operation;

      buffer = new BufferedImage
      (
         picture.getWidth(null),
         picture.getHeight(null),
         BufferedImage.TYPE_INT_ARGB
      );
      g = buffer.createGraphics();
      g.drawImage(picture, 0, 0, null);
      transformer = new AffineTransform();
      transformer.scale(xFactor, yFactor);
      operation = new AffineTransformOp(transformer, AffineTransformOp.TYPE_BILINEAR);
      buffer = operation.filter(buffer, null);
      return(Toolkit.getDefaultToolkit().createImage(buffer.getSource()));
   }

;JOOP!
0
 
LVL 11

Author Comment

by:lijunguo
ID: 17927946
where do you put that code in? You put it in a jsp page or a serverlet page? Or an applet page. If it's not in a applet page, you are processing the image from the server side, not the client side. I've already done everything from server side with .net, such as resizing, get thumbnails, what I need is to do it on end user's machine. In their machine's memory, resize it, then upload it to the server. Not resize from the server.

Regards,
Lijunguo
0
 
LVL 24

Accepted Solution

by:
sciuriware earned 500 total points
ID: 17928397
In your case you put that code into an Applet, in the method that responds
on a mouse click or other command that requests the resizing.
It is also possible that the code is added to the code that accepts an image
and prepares it for transmission.

;JOOP!
0
 
LVL 24

Expert Comment

by:sciuriware
ID: 17993643
:)
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
The viewer will learn how to implement Singleton Design Pattern in Java.

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question