]> _ Git - cubist_pdf.git/commitdiff
wip #4804 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 19 Jan 2022 12:56:09 +0000 (13:56 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 19 Jan 2022 12:56:09 +0000 (13:56 +0100)
.idea/runConfigurations.xml [deleted file]
src/Document.php

diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml
deleted file mode 100644 (file)
index 797acea..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
-  <component name="RunConfigurationProducerService">
-    <option name="ignoredProducers">
-      <set>
-        <option value="com.android.tools.idea.compose.preview.runconfiguration.ComposePreviewRunConfigurationProducer" />
-      </set>
-    </option>
-  </component>
-</project>
\ No newline at end of file
index c3a006e6bb79225bdb4fa040d8dc2b02712811df..da341c1f9136653bfadda5fbe6826ef845c822fc 100644 (file)
@@ -69,12 +69,18 @@ class Document
             return;
         }
 
-        $fwstk = new FWSTK();
-        $fwstk->setArg('--input ' . $this->getPDFInput());
-        $fwstk->setArg('--infos');
-        $fwstk->execute();
+        $nfoFile = $this->getConvertPath() . 'infos';
 
-        $infos = $fwstk->getOutput();
+        if (!file_exists($nfoFile) || filesize($nfoFile) === 0 || filemtime($nfoFile) < filemtime($this->getPDFInput())) {
+            $fwstk = new FWSTK();
+            $fwstk->setArg('--input ' . $this->getPDFInput());
+            $fwstk->setArg('--infos');
+            $fwstk->execute();
+
+            $infos = $fwstk->getOutput();
+        } else {
+            $infos = file_get_contents($nfoFile);
+        }
 
 
         if (preg_match('/Pages:\s*(\d+)/', $infos, $matches)) {