Skip to content

Commit

Permalink
Merge pull request #40 from jdevinemt/maestro
Browse files Browse the repository at this point in the history
Actually fixed temporary file not deleted issue as well as missing binary execute permission issue
  • Loading branch information
MaestroError authored Mar 22, 2024
2 parents 1536658 + e60d70b commit cebe731
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
Empty file modified bin/php-heic-to-jpg-linux-arm64
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@
"maestroerror/heif-converter": "0.2",
"php": ">=7.4"
}
}
}
3 changes: 3 additions & 0 deletions src/HeicToJpg.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,9 @@ protected function processImage(string $source): void {
$error = \is_array($output) ? implode("\\n", $output) : $output;
// Try to convert with libheif
if (!$this->tryToConvertWithLibheif($source, $newFileName)) {
if(file_exists($newFileName)){
unlink($newFileName);
}
throw new \RuntimeException("Couldn't convert HEIC to JPG: '" . $error . "' | Bin used: '" . $this->exeName . "' HEIC: '" . $source . "' Full Command: '" . $command . "'" . " Output from heif-converter-image exe: " . $this->libheifOutput);
}
}
Expand Down

0 comments on commit cebe731

Please sign in to comment.