Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

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

Posted on 2006-11-12
4
Medium Priority
?
763 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
  • 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 2000 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses
Course of the Month21 days, 6 hours left to enroll

810 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