This commit is contained in:
2019-05-07 01:51:37 -07:00
parent 23300d6ae7
commit 02f848cb55

View File

@@ -2,7 +2,7 @@
<?php <?php
// Leaf - Tools for Book Scans // Leaf - Tools for Book Scans
$version = "0.6.1"; $version = "0.6.2";
$time_start = microtime(true); $time_start = microtime(true);
// Functions // Functions
@@ -165,6 +165,26 @@ foreach ($files as $file) {
fin(); fin();
////////////////////////////////////////////////////////////////////////////////////////////////
// Makepdf: combine finished images into a pdf with python img2pdf
//////////////////////
} elseif (args("app") == "makepdf") {
echo Welcome("Combine images into pdf");
/////////////////////////////////////////////////////////////////////////
$input = args("dir")."*.*";
$dest = basename(getcwd()).".pdf";
if (file_exists($dest)) {
$dest = basename(getcwd())."_".rand(1000,9999).".pdf";
if (file_exists($dest)) { msg("Freak accident",1); }
}
echo "Creating pdf...\n\n";
exec("img2pdf --verbose --viewer-page-layout twocolumnright --output ".$dest." ".$input);
msg("Press return to open in Acrobat",2);
exec("open ".$dest." -b com.adobe.Acrobat");
fin();
//////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////
// DPIset: batch set resolution tags // DPIset: batch set resolution tags
////////////////////// //////////////////////
@@ -653,5 +673,8 @@ if (shell_exec("exiftool -s -s -s -CropAngle ".$files[0]." 2>&1")) {
echo "\nFinished! Press return to open all files in Photoshop\n"; echo "\nFinished! Press return to open all files in Photoshop\n";
fgets(fopen("php://stdin","r")); fgets(fopen("php://stdin","r"));
exec("open ".implode(" ",$files)." -b com.adobe.Photoshop"); exec("open ".implode(" ",$files)." -b com.adobe.Photoshop");
// check bridge labels
// for i in *; do exiftool -s -s -s -Label $i; done
?> ?>