image resize and rename program

Discussion in 'Programming' started by TKR Reptiles, Dec 16, 2008.

  1. #1
    is there a way with php to make a program that resizes and renames images?

    i have a website i do and on an average every month i have 75 to 125 images i have to resize and rename to a certain naming convention. i use a ftp program to upload the images. just wondering if that is possible.
     
    TKR Reptiles, Dec 16, 2008 IP
  2. Yesideez

    Yesideez Peon

    Messages:
    196
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Sure - it's definitely possible but you must have the GD library installed on your server.

    To find out if you have, make this small script, upload it and call it.

    <?php
      phpinfo();
    ?>
    PHP:
    What you're looking for in the output is anything mentioning GD.

    EDIT: Just checked mine - once you have the info in your browser CTRL+F and search for "gd support" and it should say "enabled" in a small box titled "GD"
     
    Yesideez, Dec 16, 2008 IP
  3. TKR Reptiles

    TKR Reptiles Guest

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    ok it is enabled.
     
    TKR Reptiles, Dec 16, 2008 IP
  4. Yesideez

    Yesideez Peon

    Messages:
    196
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Now you know that, there's plenty of scripts out there that will go through a folder selecting all the images and resize them.
     
    Yesideez, Dec 16, 2008 IP
  5. TKR Reptiles

    TKR Reptiles Guest

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    ok but will it rename them to a certain naming convention?
     
    TKR Reptiles, Dec 16, 2008 IP
  6. Yesideez

    Yesideez Peon

    Messages:
    196
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #6
    That all depends on the script you find - usually they'll just take the files, resize them and write out with something added to the filename (like prefixing "tn_" for example)
     
    Yesideez, Dec 16, 2008 IP
  7. Yesideez

    Yesideez Peon

    Messages:
    196
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #7
    mediachance.com/free/thumber.htm

    Look on the right "Oscar's JPEG Thumb-Maker"

    This will run on your PC - you can get it to go through a folder (and optional subfolders) and resize the images so you can upload them.
     
    Yesideez, Dec 16, 2008 IP
  8. TKR Reptiles

    TKR Reptiles Guest

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    well the main thing i am need is the renaming part. bc i can use photoshop and run an automated deal and resize em all like that.
     
    TKR Reptiles, Dec 16, 2008 IP
  9. Yesideez

    Yesideez Peon

    Messages:
    196
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #9
    What sort of renaming format are you looking at? I can knock you up a script to rename a load of files on your server no problem but I'll have to write it tomorrow - 11:30pm here and I'll be heading off to bed soon.
     
    Yesideez, Dec 16, 2008 IP
  10. RRWH

    RRWH Active Member

    Messages:
    821
    Likes Received:
    49
    Best Answers:
    0
    Trophy Points:
    70
    #10
    If you are already doing the image resizing on your windows box then there are several applications that you can use to do the whole job.

    Depending on your naming conventions and if it is something that can be put into a template and resize and rename all your images before uploading - probably easier than doing it server side - as the resized images will be smaller to upload.

    Tell us more about how you want to rename the images.
     
    RRWH, Dec 16, 2008 IP
  11. TKR Reptiles

    TKR Reptiles Guest

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #11
    thanks Yesideez!!! he made me a sweet program that works extremely well!!!
     
    TKR Reptiles, Dec 18, 2008 IP
  12. Yesideez

    Yesideez Peon

    Messages:
    196
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #12
    If anyone wants a copy of this PHP script to rename files - PM me for a download link.
     
    Yesideez, Dec 18, 2008 IP
  13. stevesd34

    stevesd34 Peon

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #13
    pm me for download link my friend
     
    stevesd34, Dec 20, 2008 IP