Crop Image

Discussion in 'PHP' started by gigamike, Aug 15, 2007.

  1. #1
    Guys,

    Do you think its possible to create a cropping tool in php. I notice most of the cropping tool is in FLASH or Java Applet. Any ideas for PHP.

    Thanks,

    Mike
     
    gigamike, Aug 15, 2007 IP
  2. ecentricNick

    ecentricNick Peon

    Messages:
    351
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #2
    It's totally possible using the GD image functions
     
    ecentricNick, Aug 15, 2007 IP
  3. wing

    wing Active Member

    Messages:
    210
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    58
    #3
    Yup, or using imagemagick.

    :)
     
    wing, Aug 15, 2007 IP
  4. gigamike

    gigamike Active Member

    Messages:
    165
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #4
    Thanks guys,

    yes i know but how do you setup that, you ask the user to enter X,Y. I think better if there is a graphical interacation like the user draw a square on image then on double click it will be crop.

    Thanks,

    Mike
     
    gigamike, Aug 15, 2007 IP
  5. ecentricNick

    ecentricNick Peon

    Messages:
    351
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #5
    you asked if it were possible to create a cropping tool in PHP. The answer is yes.

    regardless of what you write the interface in (highly unlikely to be PHP as you'd want it to be run client side) php can still do the actual cropping part.

    if it were me, i'd use javascript or flash to provide the fancy graphics selection bit, then determine the x/y coordinates to crop from that, and use ajax to call a php script which did the cropping and served the image.
     
    ecentricNick, Aug 15, 2007 IP
  6. gigamike

    gigamike Active Member

    Messages:
    165
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #6
    ok, tnx, ill try this one http://roel.meurders.nl/web_php/12cropimage-php-image-crop/#download

    do you think js is better than flash.

    thanks,

    Mike


     
    gigamike, Aug 15, 2007 IP
  7. ecentricNick

    ecentricNick Peon

    Messages:
    351
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #8
    no language is "better" than another. it depends on your requirements and what compromises you are willing to accept. languages are designed with a particular purpose in mind and, as such, are better at doing some things than others, and poorer in other areas.

    its a bit like asking if writing a document in german is better than writing it in french - clearly it depends on who's going to be reading it and why!
     
    ecentricNick, Aug 15, 2007 IP