From 40f137c84a32d3174c5a528b15c13bbd00f1e7b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Tue, 26 Mar 2013 20:59:48 +0100 Subject: [PATCH] Upgrade php-epub-meta from upstream. Should fix coverpath on Windows. Reported by Mario --- php-epub-meta/epub.php | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/php-epub-meta/epub.php b/php-epub-meta/epub.php index 0b1fd2c..26466b2 100644 --- a/php-epub-meta/epub.php +++ b/php-epub-meta/epub.php @@ -430,6 +430,7 @@ class EPub { $mime = $item->attr('opf:media-type'); $this->coverpath = $item->attr('opf:href'); $this->coverpath = dirname('/'.$this->meta).'/'.$this->coverpath; // image path is relative to meta file + $this->coverpath = ltrim($this->coverpath,'\\'); $this->coverpath = ltrim($this->coverpath,'/'); } @@ -448,18 +449,6 @@ class EPub { } 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 - ); } /**