Skip to content

Commit

Permalink
修改图片匿名函数名称
Browse files Browse the repository at this point in the history
  • Loading branch information
goleden committed Apr 22, 2020
1 parent 69bacd7 commit a929fa0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
/vendor
/composer.lock
/examples/html
.phpunit.result.cache
4 changes: 2 additions & 2 deletions src/Word2html.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ protected function parseHtmlContent()
$replace = [];
foreach ($imgFiles[0] as $key => $imgHtml) {
$imgFile = $this->htmlPath . '/' . $imgFiles[2][$key];
if (isset($this->options['uploadCallback'])) {
$src = $this->call($this->options['uploadCallback'], [realpath($imgFile)]);
if (isset($this->options['imageCallback'])) {
$src = $this->call($this->options['imageCallback'], [realpath($imgFile)]);
} else {
$src = $this->imgToBase64($imgFile);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/ConvertTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function testPushAndPop()
public function testWord2html()
{
$html2pdf = new Word2html();
$file = $html2pdf->convert(dirname(__DIR__) . '/examples/1.doc', dirname(__DIR__) . '/examples/html/', 30, ['uploadCallback' => function ($data) {
$file = $html2pdf->convert(dirname(__DIR__) . '/examples/1.doc', dirname(__DIR__) . '/examples/html/', 30, ['imageCallback' => function ($data) {
return $data;
}]);
$this->assertEquals(true, !empty($file));
Expand Down

0 comments on commit a929fa0

Please sign in to comment.