From 7a3260ae9e1095beff4621e7031068a83c6a3ab1 Mon Sep 17 00:00:00 2001 From: Kevin Decherf Date: Wed, 29 Mar 2017 21:58:29 +0200 Subject: Save alpha channel when downloading PNG images Fixes #2805 Signed-off-by: Kevin Decherf --- src/Wallabag/CoreBundle/Helper/DownloadImages.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Wallabag/CoreBundle/Helper/DownloadImages.php b/src/Wallabag/CoreBundle/Helper/DownloadImages.php index c83f9618..0d330d2a 100644 --- a/src/Wallabag/CoreBundle/Helper/DownloadImages.php +++ b/src/Wallabag/CoreBundle/Helper/DownloadImages.php @@ -144,6 +144,8 @@ class DownloadImages $this->logger->debug('DownloadImages: Re-creating jpg'); break; case 'png': + imagealphablending($im, false); + imagesavealpha($im, true); imagepng($im, $localPath, ceil(self::REGENERATE_PICTURES_QUALITY / 100 * 9)); $this->logger->debug('DownloadImages: Re-creating png'); } -- cgit v1.2.3 From 1b70990b014189f7124357206b634ec18e97909b Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Wed, 5 Apr 2017 09:24:48 +0200 Subject: Add export notice at the end of the epub The text "Produced by wallabag with PHPePub" is the first page of any epub. On ebooks reader, it is common (e.g. kobo) to use the first page as the cover of unread books, which makes it more difficult to differentiate the books. Move the Notices chapter at the end of the book. --- src/Wallabag/CoreBundle/Helper/EntriesExport.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Wallabag/CoreBundle/Helper/EntriesExport.php b/src/Wallabag/CoreBundle/Helper/EntriesExport.php index 93c01fcb..3d36a4c8 100644 --- a/src/Wallabag/CoreBundle/Helper/EntriesExport.php +++ b/src/Wallabag/CoreBundle/Helper/EntriesExport.php @@ -148,8 +148,6 @@ class EntriesExport $book->setCoverImage('Cover.png', file_get_contents($this->logoPath), 'image/png'); } - $book->addChapter('Notices', 'Cover2.html', $content_start.$this->getExportInformation('PHPePub').$bookEnd); - $book->buildTOC(); /* @@ -170,6 +168,8 @@ class EntriesExport $book->addChapter($entry->getTitle(), htmlspecialchars($filename).'.html', $chapter, true, EPub::EXTERNAL_REF_ADD); } + $book->addChapter('Notices', 'Cover2.html', $content_start.$this->getExportInformation('PHPePub').$bookEnd); + return Response::create( $book->getBook(), 200, -- cgit v1.2.3