From cb706113cd57c369339787175a6063a2abcb6108 Mon Sep 17 00:00:00 2001 From: quenousimporte Date: Tue, 11 Jun 2024 15:00:15 +0200 Subject: [PATCH] le monde include images --- epub.php | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/epub.php b/epub.php index 9474939..1498cee 100644 --- a/epub.php +++ b/epub.php @@ -42,7 +42,7 @@ if (isset($_POST['lemonde']) && $_POST['lemonde']) { // hardcoded for now - $includeimages = false; + $includeimages = true; $includecover = false; $url = $_POST['lmurl']; @@ -112,21 +112,15 @@ $imageid = $image->ContentItemId; $imageurl = preg_replace('/GetPublicationContentItems-.*\.json/', 'Image-MEDIUM-' . $imageid . '.jpg', $url); + $tempimgpath = './temp/' . $imageid . '.jpg'; $tempcontent = file_get_contents($imageurl); - file_put_contents('temp/' . $imageid, $tempcontent); - - //$epub->AddImage('temp/' . $imageid, false, false ); - - $pagecontent .= '
'; - if ($image->HtmlText) - { - $pagecontent .= $image->HtmlText; - } + file_put_contents($tempimgpath, $tempcontent); + $pagecontent .= '
'; } } $pagecontent .= $articlebody->HtmlText; - $epub->AddPage($pagecontent, false, strip_tags($articlebody->Title)); + $epub->AddPage($pagecontent, false, strip_tags($articlebody->Title), true); } } write_epub($epub);