getting the head of a player's skin

Discussion in 'Development' started by Levi, Mar 22, 2019.

  1. Levi

    Levi Skeleton

    Messages:
    955
    GitHub:
    captainleviftw
    how do i get the head of a player's skin and save it as png?
    i tried using gd:
    PHP:
    $skin_data $sender->getSkin()->getSkinData();
            
    $size 48;

            
    $im imagecreatefromstring($skin_data);
            
    $av imagecreatetruecolor($size$size);

            
    imagecopyresized($av$im0088$size$size88);
            
    imagecolortransparent($imimagecolorat($im630));

            
    $png imagepng($av);
    but returns
    Code:
    [19:45:12] [Server thread/CRITICAL]: ErrorException: "imagecreatefromstring(): gd warning: one parameter to a memory allocation multiplication is negative or zero, failing operation gracefully" (EXCEPTION)
    
     
  2. Jules

    Jules Witch

    Messages:
    50
    GitHub:
    Julooooos
    Hi, I have exactly the same error, did you solve it ?
     
  3. Levi

    Levi Skeleton

    Messages:
    955
    GitHub:
    captainleviftw
    no i didnt
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.