Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Jul 2009
    Posts
    49
    Thanks
    11
    Thanked 0 Times in 0 Posts

    Question Can Php split an image

    Can Php get an image file and split it into a number of segments (e.g 4x4) and then display each segments as a seperate image on screen.

  • #2
    Regular Coder the-dream's Avatar
    Join Date
    Mar 2007
    Location
    Northamptonshire, UK
    Posts
    477
    Thanks
    8
    Thanked 4 Times in 4 Posts
    I haven't tried this myself, but this may be possible by cropping the image using the GD Graphic Library. See: http://www.boutell.com/gd/

  • #3
    Regular Coder
    Join Date
    Mar 2006
    Posts
    238
    Thanks
    3
    Thanked 37 Times in 37 Posts
    Yes, you could use Image Functions for it. Basically you would need to read the file with one of the functions like imagecreatefromgif(), imagecreatefromjpeg(), imagecreatefrompng() etc. depending on the image format. imagecopyresized() would help you to copy part of the image to another image. then you would send the Content-Type header with header() and output the image with imagegif(), imagejpeg(), imagepng() etc. epending on the file format.

    Edit: while I have been typing, a similar answer has been given. The forum does not have post deletion capability, so I am sorry for the duplicate post.
    Last edited by SKDevelopment; 09-05-2009 at 09:58 PM.


  •  

    Posting Permissions

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