]> source.dussan.org Git - nextcloud-server.git/commitdiff
make mp3 backend work with encryption
authorGeorg Ehrke <georg@ownCloud.com>
Tue, 28 May 2013 09:49:18 +0000 (11:49 +0200)
committerGeorg Ehrke <georg@ownCloud.com>
Tue, 28 May 2013 09:49:18 +0000 (11:49 +0200)
lib/preview/mp3.php

index 6fb4b051f4168147c9d8df7f99dfcf987fc94cd9..18f5cfde375ca992fe5bcc0cf1cf00af801ed6ad 100644 (file)
@@ -14,15 +14,20 @@ class OC_Preview_MP3 extends OC_Preview_Provider{
        }
 
        public function getThumbnail($path, $maxX, $maxY, $scalingup, $fileview) {
-               $getID3 = new getID3(); 
+               $getID3 = new getID3();
+
+               $tmppath = $fileview->toTmpFile($path);
+
                //Todo - add stream support
-               $tags = $getID3->analyze($fileview->getLocalFile($path)); 
+               $tags = $getID3->analyze($tmppath); 
                getid3_lib::CopyTagsToComments($tags); 
                $picture = @$tags['id3v2']['APIC'][0]['data'];
-               
+
+               unlink($tmppath);
+
                $image = new \OC_Image($picture);
                if (!$image->valid()) return $this->getNoCoverThumbnail($maxX, $maxY);
-               
+
                return $image;
        }