mirror of
https://github.com/wallabag/wallabag.git
synced 2024-11-06 00:49:47 +00:00
Merge pull request #3886 from wallabag/issue-3602
epub export: fix missing cover image, only for exports of one article
This commit is contained in:
commit
d5154ee2ae
1 changed files with 9 additions and 7 deletions
|
@ -165,13 +165,6 @@ class EntriesExport
|
||||||
$book->addDublinCoreMetadata(DublinCore::CONTRIBUTOR, 'PHP');
|
$book->addDublinCoreMetadata(DublinCore::CONTRIBUTOR, 'PHP');
|
||||||
$book->addDublinCoreMetadata(DublinCore::CONTRIBUTOR, 'wallabag');
|
$book->addDublinCoreMetadata(DublinCore::CONTRIBUTOR, 'wallabag');
|
||||||
|
|
||||||
/*
|
|
||||||
* Front page
|
|
||||||
*/
|
|
||||||
if (file_exists($this->logoPath)) {
|
|
||||||
$book->setCoverImage('Cover.png', file_get_contents($this->logoPath), 'image/png');
|
|
||||||
}
|
|
||||||
|
|
||||||
$entryIds = [];
|
$entryIds = [];
|
||||||
$entryCount = \count($this->entries);
|
$entryCount = \count($this->entries);
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
@ -183,6 +176,15 @@ class EntriesExport
|
||||||
// set tags as subjects
|
// set tags as subjects
|
||||||
foreach ($this->entries as $entry) {
|
foreach ($this->entries as $entry) {
|
||||||
++$i;
|
++$i;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Front page
|
||||||
|
* Set if there's only one entry in the given set
|
||||||
|
*/
|
||||||
|
if (1 === $entryCount && null !== $entry->getPreviewPicture()) {
|
||||||
|
$book->setCoverImage($entry->getPreviewPicture());
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($entry->getTags() as $tag) {
|
foreach ($entry->getTags() as $tag) {
|
||||||
$book->setSubject($tag->getLabel());
|
$book->setSubject($tag->getLabel());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue