SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Mar 2012
    Location
    Dhaka, Bangladesh
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Php image crop and resized

    I have to upload a image which is height=311 and width=238. Its not a proportional size. when i upload a image on that size, image will bad. If i got a php function which upload a image of that size which is height=311 and width=238 but original image is inner of that image and must be proportional.

    The outer blank image must be of-white .

    I am try to built but failed.

  2. #2
    SitePoint Mentor silver trophy
    Rubble's Avatar
    Join Date
    Dec 2005
    Location
    Cambridge, England
    Posts
    2,438
    Mentioned
    82 Post(s)
    Tagged
    3 Thread(s)
    If using GD I would say you need to resize the image to the largest dimension then composite it onto a off-white image 311x238.

    If using imagemagick resize the image to the largest dimension then use -extent to add the off-white background all in one go.


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
  •