Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 4 of 4
  1. #1
    Member dandono_'s Avatar
    Join Date
    Mar 2006
    Location
    Cornwall, UK
    Posts
    30
    Member #
    12919
    hi, is there a way to resize an image and write it to a file after it being uploaded via php? i'm making an image gallery which has thumbnails of images so if it downloaded a ful 1024px 786px res image just for 132px by 99px it would take a while on slow connections.
    thanks, dandono
    mmm beef

  2.  

  3. #2
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,715
    Member #
    5580
    Liked
    717 times
    Dandono ....

    Yes, use the PHP GD library. Your webhost probably already has it enabled.
    There are several tutorials with that. This is one tutorial I found rather quickly
    using Google:

    http://blazonry.com/scripting/upload-size.php

    Note: some tutorials are more for using on your own server, others are more for
    using on a webhost server ... you sort of have to look at how they're configured,
    and which ones are using command lines.

    Here's some scripts you can look at and use (already made)
    http://www.maaking.com/index.php?loadpage=scripts
    http://shiege.com/scripts/thumbnail/

    Another aspect of resizing, is using GD "resample" vs "resize". I've noticed that
    "resample" produces better quality images, but is slower. Don't know if that's
    a result of my webhost or not. I've resorted to using Perl Imagemagick in many
    cases because the quality seems so much better. But you want to use PHP
    instead of Perl.

    In any case, image manipulation is an interesting thing to learn.


  4. #3
    Member dandono_'s Avatar
    Join Date
    Mar 2006
    Location
    Cornwall, UK
    Posts
    30
    Member #
    12919
    is there a way to resize a png image?
    thanks
    mmm beef

  5. #4
    Senior Member
    Join Date
    Jun 2005
    Location
    Atlanta, GA
    Posts
    4,146
    Member #
    10263
    Liked
    1 times
    Yes, [phpfunction]imagecopyresampled[/phpfunction], as per mlseim's post ;-)


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 08:07 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com