Photo re-sizing code for member-base web site

Discussion in 'Perl Misc' started by BWIN, Oct 14, 2005.

  1. BWIN

    BWIN Guest

    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
    BWIN, Oct 14, 2005
    #1
    1. Advertising

  2. BWIN

    Scott Bryce Guest

    BWIN wrote:

    > 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.
    Scott Bryce, Oct 14, 2005
    #2
    1. Advertising

  3. BWIN

    Guest

    Scott Bryce writes:
    > Brandon Winnie wrote:


    >> 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.


    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.)

    --
    You know mighty well that Prof. A. Sinan Unur ain't never
    has neighbored with our kind of trash, and I don't know
    what's done come over me that I am taking profanity out of
    my own children's mouth and feeding it to that Perl brood.
    , Oct 14, 2005
    #3
  4. BWIN

    Anno Siegel Guest

    <> wrote in comp.lang.perl.misc:
    > Scott Bryce writes:
    > > Brandon Winnie wrote:

    >
    > >> 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.

    >
    > 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
    --
    If you want to post a followup via groups.google.com, don't use
    the broken "Reply" link at the bottom of the article. Click on
    "show options" at the top of the article, then click on the
    "Reply" at the bottom of the article headers.
    Anno Siegel, Oct 14, 2005
    #4
  5. BWIN

    Matt Garrish Guest

    "Anno Siegel" <-berlin.de> wrote in message
    news:dintn0$qou$-Berlin.DE...
    > <> wrote in comp.lang.perl.misc:
    >> Scott Bryce writes:
    >> > Brandon Winnie wrote:

    >>
    >> >> 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.

    >>
    >> 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.
    >


    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
    Matt Garrish, Oct 14, 2005
    #5
  6. BWIN

    Dr.Ruud Guest

    schreef:

    > ImageMagick


    Or GD.

    --
    Affijn, Ruud

    "Gewoon is een tijger."
    Dr.Ruud, Oct 14, 2005
    #6
  7. BWIN

    Ian Wilson Guest

    Anno Siegel wrote:
    > <> wrote in comp.lang.perl.misc:
    >
    >>Scott Bryce writes:
    >>
    >>>Brandon Winnie wrote:

    >>
    >>>>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.

    >>
    >>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.
    >


    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.
    Ian Wilson, Oct 14, 2005
    #7
  8. BWIN

    Scott Bryce Guest

    wrote:

    > Scott Bryce writes:
    >
    >>Brandon Winnie wrote:

    >
    >
    >>>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.

    >
    >
    > 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.
    Scott Bryce, Oct 14, 2005
    #8
  9. BWIN

    Babacio Guest

    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.

    --
    Bé erre hue ixe eu elle, Bruxelles.
    Babacio, Oct 14, 2005
    #9
  10. BWIN

    Scott Bryce Guest

    Ian Wilson wrote:

    > 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.
    Scott Bryce, Oct 14, 2005
    #10
  11. BWIN

    Ian Wilson Guest

    Scott Bryce wrote:
    > Ian Wilson wrote:
    >
    >> 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 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 :)
    Ian Wilson, Oct 14, 2005
    #11
  12. BWIN

    Scott Bryce Guest

    Ian Wilson wrote:

    > 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.
    Scott Bryce, Oct 14, 2005
    #12
  13. writes:

    >> Brandon Winnie wrote:

    >
    >>> 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??

    >
    > 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--

    --
    Cocoa programming in Perl: http://camelbones.sourceforge.net
    Hire me! My resume: http://www.dot-app.org
    Sherm Pendley, Oct 14, 2005
    #13
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. RC
    Replies:
    2
    Views:
    457
    John M Deal
    Nov 24, 2004
  2. Siemel Naran
    Replies:
    4
    Views:
    789
    Micah Cowan
    Jan 12, 2005
  3. savvas
    Replies:
    4
    Views:
    1,385
    Michael Nemtsev [MVP]
    Feb 7, 2008
  4. Angus
    Replies:
    1
    Views:
    2,609
  5. K. Frank
    Replies:
    8
    Views:
    628
    K. Frank
    Mar 22, 2012
Loading...

Share This Page