Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Oct 2002
    Posts
    147
    Thanks
    31
    Thanked 2 Times in 2 Posts

    resize image on upload

    Hi

    I want to write a little script that uploads an image and resizes it.

    But I want to write it myself without using someone else's code.

    so here here is my question:

    What php function do you recommend for resizing the image that I upload

    eg upload a 400px x 400px 1mb jpg and convert it to a 100px x 100px 30 kb jpg.

    or do you have a URL that explains more about this concept?

    I would also like to do it in standard php5?

    is this posible?

    thanks for the help

    Thanks

    A

  • #2
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,509
    Thanks
    8
    Thanked 1,090 Times in 1,081 Posts
    You will be using PHP GD.

    Here is a place to start with many script examples.
    I know you want to write your own, but these examples explain a lot:
    http://us.php.net/manual/en/function...yresampled.php

    You'll be doing a PHP upload script that saves the full-size original image,
    and then loads that full-size and makes a thumbnail, and resaves it either
    into a different directory or a different filename (add _t ) to the filename?

    To get to GD help quickly for various topics, use Google.
    Type PHP GD and then the word you're looking for,
    Example: PHP GD getimagesize

  • Users who have thanked mlseim for this post:

    andrew1234 (09-07-2009)

  • #3
    Regular Coder
    Join Date
    Oct 2002
    Posts
    147
    Thanks
    31
    Thanked 2 Times in 2 Posts
    thanks


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •