SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Jun 2007
    Location
    Frankfurt/Germany
    Posts
    66
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Build square thumbnail by cutting off l/r slices

    Gentlemen,

    I intend to build square thumbnails by cutting off parts of the image (given the original format is not square). Currently I am using GD for image manipulation.

    Let me give you an example:
    User image upload is 600x400px. I resize it to 60x40 using imagecopyresampled.

    My question is: How can I cut off 10px from the left and 10px from the right, resulting in a nice 40x40px thumbnail?

    Thank you very much for your help,
    Wolfgang

  2. #2
    SitePoint Mentor silver trophy
    Rubble's Avatar
    Join Date
    Dec 2005
    Location
    Cambridge, England
    Posts
    2,194
    Mentioned
    71 Post(s)
    Tagged
    3 Thread(s)
    Use Imagemagick

    I would look at Imagecrop

    You may have to do some calculations to pass the positions to the crop function.

  3. #3
    SitePoint Enthusiast
    Join Date
    Jun 2007
    Location
    Frankfurt/Germany
    Posts
    66
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    FYI: I decided to give the ImageWorkshop Class a try (found on http://phpimageworkshop.com/).

    Thank you,
    Wolfgang


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
  •