Skip to content

Commit

Permalink
add usage of Imagick pingImage to speedup the page count
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenvanassche committed Apr 29, 2020
1 parent 67136ab commit b0d7ab0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions .phpunit.result.cache
@@ -0,0 +1 @@
C:37:"PHPUnit\Runner\DefaultTestResultCache":1164:{a:2:{s:7:"defects";a:0:{}s:5:"times";a:11:{s:98:"Spatie\PdfToImage\Test\PdfTest::it_will_throw_an_exception_when_try_to_convert_a_non_existing_file";d:0.006;s:102:"Spatie\PdfToImage\Test\PdfTest::it_will_throw_an_exception_when_try_to_convert_to_an_invalid_file_type";d:0.144;s:103:"Spatie\PdfToImage\Test\PdfTest::it_will_throw_an_exception_when_passed_an_invalid_page with data set #0";d:0.116;s:103:"Spatie\PdfToImage\Test\PdfTest::it_will_throw_an_exception_when_passed_an_invalid_page with data set #1";d:0.116;s:103:"Spatie\PdfToImage\Test\PdfTest::it_will_throw_an_exception_when_passed_an_invalid_page with data set #2";d:0.117;s:88:"Spatie\PdfToImage\Test\PdfTest::it_will_correctly_return_the_number_of_pages_in_pdf_file";d:0.189;s:76:"Spatie\PdfToImage\Test\PdfTest::it_will_accept_a_custom_specified_resolution";d:0.449;s:64:"Spatie\PdfToImage\Test\PdfTest::it_will_convert_a_specified_page";d:0.503;s:86:"Spatie\PdfToImage\Test\PdfTest::it_will_accept_a_specified_file_type_and_convert_to_it";d:0.414;s:53:"Spatie\PdfToImage\Test\PdfTest::it_can_accept_a_layer";d:0.255;s:63:"Spatie\PdfToImage\Test\PdfTest::it_will_set_compression_quality";d:0.414;}}}
4 changes: 4 additions & 0 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,10 @@

All notable changes to `pdf-to-image` will be documented in this file

## 2.0.1 - 2020-01-08

- add usage of Imagick `pingImage` to speedup the page count

## 2.0.0 - 2020-01-08

- added typehints
Expand Down
4 changes: 3 additions & 1 deletion src/Pdf.php
Expand Up @@ -35,7 +35,9 @@ public function __construct(string $pdfFile)
throw new PdfDoesNotExist("File `{$pdfFile}` does not exist");
}

$this->imagick = new Imagick($pdfFile);
$this->imagick = new Imagick();

$this->imagick->pingImage($pdfFile);

$this->numberOfPages = $this->imagick->getNumberImages();

Expand Down

0 comments on commit b0d7ab0

Please sign in to comment.