为什么我的图像编辑器脚本说语法错误

I am trying to create my image editor site but I face a lot of problems in making this site. The problem is that it says syntax error when I upload it to my web hosting site.


 <?
    include_once('ImageEditor.php');
    $src = new ImageEditor();
    $dst = new ImageEditor();
    $dst->createCanvas(200, 400);
    $src->loadImageFile('nalin.jpg' );
    $dst->fillin($src, 0, 1000);
    $drop = new ImageEditor();
    $drop->loadImageFile('1.jpg');
    #$dst->dropin($drop, 20 ,50);
    $dst->fillinArea($drop, 10, 20, 100, 100);
    $dst->fillinArea($drop, 10, 350, 100, 100);
    #$src->rotate(90);
    #$dst->fitin($src);
    #$dst->applyGrayscale();
    #$dst->pseudosepia(20);
    #$dst->sepia(60);
    #$dst->grayscale();
    $dst->writeImageFile('out.jpg', ImageEditor::JPG, 75);
    #$src->writeImageFile('out.jpg', ImageEditor::JPG, 75);
    #$dst->displayImage('JPG');
    ?>

And my ImageEditor.php is taken from GitHub you easily [check this][1].


I face a error when I upload it to my web hosting site:

Fatal error: Class 'ImageEditor' not found in /home/a2226731/public_html/image.php on line 3


According to your github ImageEditor.php path is inside lib/ folder. Use

require_once('lib/ImageEditor.php')

instead of

include_once('ImageEditor.php');