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