PHP - Cropping Habbo figure

Results 1 to 3 of 3
  1. #1
    Elite Member robertdobson is offline
    Member +Rank
    Mar 2010 Join Date
    142Posts

    PHP - Cropping Habbo figure

    Hi,
    I'm trying to create a script that grabs a figure image from habbo-imaging, and crops it to a square containing the figure's head and shoulders.

    PHP Code:
    <?php
    header
    "Content-type: image/png" );
    $figure "hr-828-45.lg-285-64.ch-215-110.hd-180-2.sh-290-62.he-1607-";

        
    $original_image imagecreatefrompng("http://www.habbo.com.tr/habbo-imaging/avatarimage?figure=".$figure."");

        
    // create a blank image having the same width and height as the crop area
        // this will be our cropped image
        
    $cropped_image imagecreatetruecolor(6464);

        
    // copy the crop area from the source image to the blank image created above
        
    imagecopy($cropped_image$original_image0064216464);
                  
        
    imagepng($cropped_image);
       
        
    // free resources
        
    imagedestroy($cropped_image);
        
    imagedestroy($original_image);
    ?>
    That's what I've got so far, and all the script generates is a black square.

    Any ideas?


  2. #2
    Grand Master asesinato is offline
    Grand MasterRank
    Aug 2014 Join Date
    601Posts

    Re: PHP - Cropping Habbo figure

    All you need to do is use css to crop it.

  3. #3
    Evil Italian Overlowrd Droppy is offline
    Grand MasterRank
    Feb 2012 Join Date
    /home/droppyLocation
    2,080Posts

    Re: PHP - Cropping Habbo figure

    Add in the request:
    headonly=1
    Example:

    https://www.habbo.com/habbo-imaging/...ere&headonly=1



Advertisement