1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Error: "Call to undefined function Boss\imagecreatefrompng()" (EXCEPTION) in "plugins/BossJG-master/

Discussion in 'Development' started by Mochi, May 30, 2019.

  1. Mochi

    Mochi Baby Zombie

    Messages:
    113
    Code :
    PHP:
        public function getSkin(string $fileName) : ?Skin{
            
    $path $this->getDataFolder()  . "skins" DIRECTORY_SEPARATOR .  $fileName ".png";

            if(!
    is_file($path)){
                return 
    null;
            }

            
    $img = @imagecreatefrompng($path);
            
    $bytes '';
            
    $l = (int) @getimagesize($path)[1];
            for (
    $y 0$y $l$y++) {
                for (
    $x 0$x 64$x++) {
                    
    $rgba = @imagecolorat($img$x$y);
                    
    $a = ((~((int)($rgba >> 24))) << 1) & 0xff;
                    
    $r = ($rgba >> 16) & 0xff;
                    
    $g = ($rgba >> 8) & 0xff;
                    
    $b $rgba 0xff;
                    
    $bytes .= chr($r) . chr($g) . chr($b) . chr($a);
                }
            }
     
  2. KielKing

    KielKing Zombie

    Messages:
    245
    GitHub:
    kielking
    do you have the GD extension enabled?
     
  3. Eren5960

    Eren5960 Spider Jockey

    Messages:
    27
    GitHub:
    Eren5960
    You must enable GD2 extension from php.ini. İf you use linux you must compile GD2 extension.

    Windows:
    Code:
    extension=php_gd2.dll
    Linux:
    Code:
    ./compile.sh -d
    compile.sh in github github.com/pmmp/php-build-scripts/
     
  4. Mochi

    Mochi Baby Zombie

    Messages:
    113
    I use this application to test plugins
     

    Attached Files:

  5. Mochi

    Mochi Baby Zombie

    Messages:
    113
    Is this?
     

    Attached Files:

  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.