Upgrade php-epub-meta from upstream. Should fix coverpath on Windows. Reported by Mario

This commit is contained in:
Sébastien Lucas 2013-03-26 20:59:48 +01:00
parent f9c6e8277b
commit 40f137c84a

View file

@ -430,6 +430,7 @@ class EPub {
$mime = $item->attr('opf:media-type'); $mime = $item->attr('opf:media-type');
$this->coverpath = $item->attr('opf:href'); $this->coverpath = $item->attr('opf:href');
$this->coverpath = dirname('/'.$this->meta).'/'.$this->coverpath; // image path is relative to meta file $this->coverpath = dirname('/'.$this->meta).'/'.$this->coverpath; // image path is relative to meta file
$this->coverpath = ltrim($this->coverpath,'\\');
$this->coverpath = ltrim($this->coverpath,'/'); $this->coverpath = ltrim($this->coverpath,'/');
} }
@ -448,18 +449,6 @@ class EPub {
} }
if (!$hascover) return $this->no_cover(); if (!$hascover) return $this->no_cover();
$zip = new ZipArchive();
if(!@$zip->open($this->file)){
throw new Exception('Failed to read epub file');
}
$data = $zip->getFromName($this->coverpath);
return array(
'mime' => $mime,
'data' => $data,
'found' => $this->coverpath
);
} }
/** /**