?
Solved

Is it possible to crop a jpg in the browser before upload? URGENT!!!

Posted on 2006-05-03
7
Medium Priority
?
435 Views
Last Modified: 2011-10-03
Hi,

I am facing the task of creating a webpage where the user can browse to a certain file on his/her HDD and display the picture in the browser. Once it is done, he needs to be able to crop the picture and finally upload it to the web server.

IS THIS POSSIBLE?

If so HOW????  ( am happy to give an extra 500 points...:-) )

TIA,

Tom
0
Comment
Question by:tom_szabo
  • 4
  • 3
7 Comments
 
LVL 11

Expert Comment

by:WelkinMaze
ID: 16595020
Hi,
I think that the most appropriate way is to send the picture to the server along with some parameters entered by the user. And then do the cropping at server side.
0
 

Author Comment

by:tom_szabo
ID: 16595059
I agree, but we may generate too much traffic.

Can we use the browser (some function of it, java script, whatever) to compress the image?

0
 
LVL 11

Expert Comment

by:WelkinMaze
ID: 16595071
The most image formats like jpg, tiff and so on are already compressed (with or without information loss). So unless the images are not BMP files no additional compression could be achieved :(
0
Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

 

Author Comment

by:tom_szabo
ID: 16595263
As far as I understand you are only partially correct. JPG has different levels of compression and that is quite obvious from taking a picture with a digital camera, copy it on the HDD. It takes up 2MB space. Now you simply open the picture with MS-Paint and save it back. And the picture is now 200-500kb. Haven't cropped or changed anything and it is 1/4th to 1/8th of its size.

While the raw file from the camera is compressable,  zipping is not going to help much since zipping will compress in a different manner than the JPG compression works.

If we do what you have suggested, we need to upload the 2MB file. If we could compress the file it would reduce the traffic to its quarter.

The question still remains:

Is it possible to manipulate the pic from the browser?

0
 
LVL 11

Expert Comment

by:WelkinMaze
ID: 16595385
You are right about JPG but this way you lose quality. In practice this is not a real gain from compression, this is a gain on account of the quality. So this is the reason I haven't mentioned it.
I suppose you would be able to do this manipulation inside a browser with the hlep of some applet or active x control. I think this could not be done just with javascript scripting.
0
 

Author Comment

by:tom_szabo
ID: 16595584
Ok, you are right too, JPG compression is based on loosing "un-noticable quality"....

So to be more specific, I would need to set the pic to a 300dpi resolution and reasonable quality. the aim is that the user doesn't need to explicitly download and install any software. If we can seemlessly dowload, install and utilise an active X, that is considered a solution, but I am slightly concerned that we might run into security problems...

Are there some OS components that we could utilize through the browser?
0
 
LVL 11

Accepted Solution

by:
WelkinMaze earned 2000 total points
ID: 16595736
I'm not a hundred percent sure but I think it cannot be done from a browser without utilizing some additional components.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Internet is a big network which is formed by connecting multiple small networks.It is a platform for all the users which are connected to it.Internet act as platform in different fields. Such as: Internet  as a collaboration platform. Internet  as…
Several part series to implement Internet Explorer 11 Enterprise Mode
This Micro Tutorial will demonstrate how to add subdomains to your content reports. This can be very importing in having a site with multiple subdomains.
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses
Course of the Month16 days, 13 hours left to enroll

864 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