Results 1 to 2 of 2

Thread: Resize Upload Images in PHP

  1. #1
    PetersonClark is offline Senior Member
    Join Date
    Dec 2009
    Posts
    202
    Rep Power
    3

    Default Resize Upload Images in PHP

    Hi. I am working in live project where I use PHP programming language. In my project one form is there in that form image upload function is there. Using this function user upload their image. I want Resize Upload Images. It is possible? If possible please give me proper code for that. Thank you.

  2. #2
    CollinsBrown is offline Senior Member
    Join Date
    Dec 2009
    Posts
    213
    Rep Power
    3

    Default

    PHP has the capacity to upload files such as documents or images using the multiple form-data protocol. Here’s the code to convert, scale and write out a scaled JPG image.

    Code:
    /*== where storing tmp img file ==*/
     = tempnam("/tmp" "MKPH");
     = "/scaled.jpg";
    
    /*== CONVERT IMAGE TO PNM ==*/
    if ( == "jpg") { system("djpeg  >"); } 
    else { echo("Extension Unknown. Please only upload a JPEG image."); exit(); } 
    
    /*== scale image using pnmscale and output using cjpeg ==*/
    system("pnmscale -xy 250 200  | cjpeg -smoo 10 -qual 50 >");

Similar Threads

  1. Resize Your Images Quickly with Image Resizer
    By PerezMorris in forum Applications
    Replies: 0
    Last Post: 04-30-2010, 01:44 PM
  2. How to resize a partition in Vista
    By Edgardo Chappel in forum Windows Vista
    Replies: 0
    Last Post: 10-14-2009, 09:59 AM
  3. Quickly resize images (XP)
    By qeintine641 in forum Windows XP
    Replies: 0
    Last Post: 03-31-2009, 06:06 AM
  4. Upload images to Picasa
    By niks54 in forum Everything Else
    Replies: 0
    Last Post: 03-10-2009, 12:08 PM
  5. Resize proportionately
    By oakkal64 in forum Operating System
    Replies: 0
    Last Post: 10-21-2008, 08:21 AM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48