?
Solved

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

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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

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 …
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses
Course of the Month13 days, 7 hours left to enroll

800 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