php-image-optim icon indicating copy to clipboard operation
php-image-optim copied to clipboard

Wrong command order

Open within25 opened this issue 5 years ago • 0 comments

    foreach ($this->chainedCommands as $chainedCommand) {
        $chainedCommand->determinePreOptimisedFileSize();
        $chainedCommand->setImagePath($this->imagePath);
        $chainedCommand->optimise();
        $chainedCommand->determinePostOptimisedFileSize();
    }

first must be setImagePath and only then determinePreOptimisedFileSize

we get an error Unable to determine pre-optimized fileSize

because $ this-> imagePath is still empty

within25 avatar Jun 17 '20 11:06 within25