Photo re-sizing code for member-base web site

B

BWIN

I am the owner of a very large scale member-base website and the
members are having trouble re-sizing there pics to create headshots.
The headshots are supposed to be 175 x 175 pixels exactly. We get alot
of people trying to re-size their own images and unfortunatley they
don't have photo skills and the images never get uploaded because they
are usually off a few pixels when trying to upload the headshot. So the
headshot's usually don't get uploaded.

So here is my Question: Is there any kind of software or javascript
coding that I can implement into my website that will allow a member
that has, lets say an image that is 240 x 190, to drop that photo in to
almost like a pre-made box that is 175 x 175 and then they can drag,
move, re-size their pic all they want in the box and then save it??

If anyone has any suggestions or help for this that would be greatly
appreciated. I am desperate. Thanks!

BWIN
 
S

Scott Bryce

BWIN said:
So here is my Question: Is there any kind of software or javascript
coding that I can implement into my website that will allow a member
that has, lets say an image that is 240 x 190, to drop that photo in to
almost like a pre-made box that is 175 x 175 and then they can drag,
move, re-size their pic all they want in the box and then save it??

Is there a reason you are asking this in a Perl newsgroup? If such an
application exists, it is probably not written in Perl.
 
B

babydoe

Scott said:
Brandon Winnie wrote:

Is there a reason you are asking this in a Perl
newsgroup? If such an application exists, it is
probably not written in Perl.

Scott, sugar, Brandon ain't such a start natural fool.
ImageMagick is the reference standard for imaging, and
ImageMagick is well supported in Perl. Resizing a photo
with ImageMagick is as simple as:

C:\>convert mypic.jpg -resize 175 mythumb.jpg

Cropping and trimming a photo is just as easy, and if I
were to want such a service on my webpage, I would look
at Perl and ImageMagick. (Tho' I think fixing your
photo, and spell checking, and other personal grooming
stuff, should be done before you upload to a website.)
 
A

Anno Siegel

Scott, sugar, Brandon ain't such a start natural fool.
ImageMagick is the reference standard for imaging, and
ImageMagick is well supported in Perl. Resizing a photo
with ImageMagick is as simple as:

C:\>convert mypic.jpg -resize 175 mythumb.jpg

Yes. Have you read the question?

How will that "allow a member ... to drop that photo in to a pre-made
box that is 175 x 175 and then they can drag, move, re-size their pic..."?

That's a client-side process, unlikely to be implemented in Perl.

Anno
 
M

Matt Garrish

Anno Siegel said:
Yes. Have you read the question?

How will that "allow a member ... to drop that photo in to a pre-made
box that is 175 x 175 and then they can drag, move, re-size their pic..."?

That's a client-side process, unlikely to be implemented in Perl.

Not necessarily. He obviously wants the user to be able to specify the
cropping on the client side, but I suspect some server-side processing would
be needed to perform the actual cropping of the image, and that's where perl
would come in. I'm not sure how he'd make this bounding box or obatin the
start coordinate to crop from, but it's probably not an impossible task.

Matt
 
I

Ian Wilson

Anno said:
Yes. Have you read the question?

How will that "allow a member ... to drop that photo in to a pre-made
box that is 175 x 175 and then they can drag, move, re-size their pic..."?

That's a client-side process, unlikely to be implemented in Perl.

http://magick.net4tv.com/

"Here is your image. Click on a tab above to interactively resize,
rotate, sharpen, color reduce, or add special effects to your image and
save the completed work in the same or differing image format. Press
Back to undo your last image transformation. For more information, see
ImageMagick."

I've no idea if their "*.cgi" URLs are Perl but I see no reason you
couldn't do this using Perl::Magick and CGI

Just my GBP 0.02 worth.
 
S

Scott Bryce

Scott, sugar, Brandon ain't such a start natural fool.
ImageMagick is the reference standard for imaging, and
ImageMagick is well supported in Perl. Resizing a photo
with ImageMagick is as simple as:

Or maybe he is. In order for such a process to run in a user's browser,
the user would have to have both Perl and ImageMagic installed on his
machine.
 
B

Babacio

Scott Bryce
Or maybe he is. In order for such a process to run in a user's
browser, the user would have to have both Perl and ImageMagic
installed on his machine.

Or he may waits something like a reference to Image::Resize, which
itself uses GD.
 
S

Scott Bryce

Ian said:
http://magick.net4tv.com/

"Here is your image. Click on a tab above to interactively resize,
rotate, sharpen, color reduce, or add special effects to your image and
save the completed work in the same or differing image format. Press
Back to undo your last image transformation. For more information, see
ImageMagick."

But Brandon's target audience includes people who have trouble resizing
or croping an image in a paint package. I doubt this would be much
easier for them.
 
I

Ian Wilson

Scott said:
But Brandon's target audience includes people who have trouble resizing
or croping an image in a paint package. I doubt this would be much
easier for them.

I agree, In Brandon's shoes I'd consider using ImageMagick behind the
scenes to simply force any mis-sized uploaded images to the desired size.

I suppose you could present the cropped/resampled result back to the
user and let them iteratively choose a limited number of options (zoom
out a bit, zoom in a bit, left a bit, up a bit, fire!)

For a more truly GUI interactive approach I suppose you could write a
custom Java applet that just exposes the minimal shift and zoom controls
needed (and hope they have a JVM etc etc) but this development effort
would be overkill for a small website (maybe not for a "very large scale
member-base website").

This is of course OT for CLPM so I'll apologise and shut up now :)
 
S

Scott Bryce

Ian said:
I agree, In Brandon's shoes I'd consider using ImageMagick behind the
scenes to simply force any mis-sized uploaded images to the desired
size.

A great idea, but since ImageMagic can't see the image, it wouldn't know
where to do the cropping. Simply resizing could possible distort the
image, if the original is not in the correct aspect ratio.

I suppose you could present the cropped/resampled result back to the
user and let them iteratively choose a limited number of options
(zoom out a bit, zoom in a bit, left a bit, up a bit, fire!)

It is hard to say whether this would solve the problem.

For a more truly GUI interactive approach I suppose you could write a
custom Java applet that just exposes the minimal shift and zoom
controls needed

Yes. I did not recommend this because...
but this
development effort would be overkill for a small website

.... of this...
This is of course OT for CLPM

... and this.

But if something similar already exists, this might be a good solution.
Google or a Java newsgroup might be Brandon's next stop.
 
S

Sherm Pendley

ImageMagick is the reference standard for imaging, and
ImageMagick is well supported in Perl. Resizing a photo
with ImageMagick is as simple as:

C:\>convert mypic.jpg -resize 175 mythumb.jpg

A PerlMagick-based CGI would be able to take an uploaded file and make it
fit within the specified constraints, but no way could it do what Brandon's
asking for. That would need a browser-side applet or plugin.

sherm--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,820
Latest member
GilbertoA5

Latest Threads

Top