Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Resizing images automatically

Options
  • 29-04-2006 11:18am
    #1
    Registered Users Posts: 673 ✭✭✭


    Hey,

    I was just wondering how you deal with setting up a cms for a client where they need to upload images. Do you just do a resize on them for the large images and thumbnails to make sure they are the correct size?

    Im also worried that they will uploading massive image file sizes to the site when all they want is a thumbnail sized image. How do you get around this type of thing? Do you show the client how to resize and optimize images or are their ways around these problems that im missing?

    Thanks


Comments

  • Closed Accounts Posts: 238 ✭✭AngryAnderson


    You can do it with PHP very easily. I code ASP and use ASPUpload and ASPJpeg (http://www.persits.com/) components to resize and handle my images but they're costly. Another reason why ASP is outdated and crap really.

    Regardless of which scripting language you use, you can limit the file size if you want and you can resize the images on the server.


  • Registered Users Posts: 3,514 ✭✭✭Rollo Tamasi


    there should be a ton of php scripts for "image upload resize php" on the net.

    edit*
    yup there is


  • Registered Users Posts: 673 ✭✭✭Bananna man


    there should be a ton of php scripts for "image upload resize php" on the net.

    edit*
    yup there is

    I know there is, my real question was about the file sizes people will be uploading. Is this a problem?


  • Closed Accounts Posts: 238 ✭✭AngryAnderson


    Not really. You can limit the maximum file size that the user can upload.


  • Registered Users Posts: 673 ✭✭✭Bananna man


    Not really. You can limit the maximum file size that the user can upload.

    This can be a problem. Alot of the time when your setting up say an ecommerce site, the people your doing it for are completely computer illeterite. Trying to explain to then how to optimize and image can be a real problem!!


  • Advertisement
  • Closed Accounts Posts: 1,200 ✭✭✭louie


    you can have the image resized twice (450px and 100px) from the original if they are bigger then that.


  • Closed Accounts Posts: 238 ✭✭AngryAnderson


    This can be a problem. Alot of the time when your setting up say an ecommerce site, the people your doing it for are completely computer illeterite. Trying to explain to then how to optimize and image can be a real problem!!

    I'm going to start flicking you on the head soon :p


  • Registered Users Posts: 3,514 ✭✭✭Rollo Tamasi


    This can be a problem. Alot of the time when your setting up say an ecommerce site, the people your doing it for are completely computer illeterite. Trying to explain to then how to optimize and image can be a real problem!!

    eh? but the script can resize the image for you.....


  • Registered Users Posts: 673 ✭✭✭Bananna man


    eh? but the script can resize the image for you.....

    Does it resise the file size???? I thought it would just resise the dimensions


  • Closed Accounts Posts: 1,200 ✭✭✭louie


    why don't you try to find out how the GD library & PHP works before you post something stupid like this?


  • Advertisement
  • Registered Users Posts: 673 ✭✭✭Bananna man


    louie wrote:
    why don't you try to find out how the GD library & PHP works before you post something stupid like this?

    If you have nothing helpful to say why do you have to moan on the forum? Im sick of this type of behaviour. Usually its someone who comes on here not knowing a thing about web design, looking for a bit of help and all they get is abuse from "the experts". Get a life and if you have nothing constructive to say, dont say it!!

    I didnt even know about the GD library as i am relatively new to php, hence coming onto a webmaster forum abd asking a question about it. :mad:


  • Closed Accounts Posts: 1,200 ✭✭✭louie


    You totally got me wrong there.
    I said that in your own defense. I used to be like you once but google was my friend, and only asked questions when i did have the code but didn't know how exactly works so I could change it to suit me.


  • Closed Accounts Posts: 238 ✭✭AngryAnderson


    Google is your friend.


  • Registered Users Posts: 5,517 ✭✭✭axer


    Hey,

    I was just wondering how you deal with setting up a cms for a client where they need to upload images. Do you just do a resize on them for the large images and thumbnails to make sure they are the correct size?

    Im also worried that they will uploading massive image file sizes to the site when all they want is a thumbnail sized image. How do you get around this type of thing? Do you show the client how to resize and optimize images or are their ways around these problems that im missing?

    Thanks
    What CMS are you using or did you create one yourself? You could always setup something like irfanview to batch resize/optimise images for the web before uploading them but I would suggest the CMS tumbnailing the images if needs be or things may get a little too complicated.


  • Closed Accounts Posts: 2,046 ✭✭✭democrates


    Php with gd support works fine.
    To see if gd is available on the hosting site upload a file named say php123.php as follows
    [PHP]<?php
    phpinfo();
    ?>
    [/PHP]
    Call it from your browser and search for gd
    If it's supported you're set.
    (then delete php123.php, don't leave it for crafty malicious hackers to footprint for an attack)

    Even if a person uploads a 10MB file you should allow it, but then have the upload-resize script resize it to say 400x300 and a 80x60 thumb, store both of these and delete the 10MB file.


  • Registered Users Posts: 3,886 ✭✭✭cgarvey


    Resizing server-side is easy. I've used PHP/GD, ASP/Persists component and Java AWT (which needs either X or VNC running to render graphics, on a Linux box) to resize. All come with plenty of examples.

    The only problem that I need to look into more is to limit the upload side CLIENT-side, so as to save someone on dialup with no clue uploading a 10MB file that'll be reduced to a few KB server-side anyway. The workaround I've done is just to use a progress bar with a warning (suggesting a resize, etc.) if it's going to take a while.

    .cg


  • Registered Users Posts: 673 ✭✭✭Bananna man


    democrates wrote:
    Php with gd support works fine.
    To see if gd is available on the hosting site upload a file named say php123.php as follows
    [PHP]<?php
    phpinfo();
    ?>
    [/PHP]
    Call it from your browser and search for gd
    If it's supported you're set.
    (then delete php123.php, don't leave it for crafty malicious hackers to footprint for an attack)

    Even if a person uploads a 10MB file you should allow it, but then have the upload-resize script resize it to say 400x300 and a 80x60 thumb, store both of these and delete the 10MB file.


    My hopsting does support GD so i'll have to get to grips with that today. Whats this about deleting php123.php though?


  • Closed Accounts Posts: 1,200 ✭✭✭louie


    php123.php is just the name of the file that democrates wrote the php_info(); into.

    You don't have it on the server unless you create it. The reson you delete that file is, it contains all the php server details.
    Is more for yourself to see what's there and what's not.

    If you hosting doesn't supports GD, I recon you should find a better one.

    GD library is free (open source).


Advertisement