php SimpleImage 库不断更新原始文件.错误在哪里


php SimpleImage library keep updating the original file. where is the error?

我正在使用php操作一些图像,并决定使用这个库,因为它似乎完全符合我的需要。我的问题是save()方法继续覆盖原始文件而不是创建 b.jpg。

我的 php 文件:

<?php 
    include "lib/SimpleImage.php";
    $img = new abeautifulsite'SimpleImage($_GET["path_source"]);
    $img->rotate(90);
    $img->save($_GET["path_dest"]);
?>

我传递的参数path_source=img/a.jpg和path_dest=img/b.jpg

我做错了什么?

我还在库的 github 页面上打开了一个问题。

感谢Yann Sagon,我发现了thar 语法:

$filename   = $filename ?: $this->filename;

(在库中使用)不受我的 PHP 版本支持

将其更改为:

if($filename==null){
        $filename=$this->filename;
        }