@@ -29,38 +29,38 @@ |
||
| 29 | 29 | use ID3Parser\ID3Parser; |
| 30 | 30 | |
| 31 | 31 | class MP3 extends Provider { |
| 32 | - /** |
|
| 33 | - * {@inheritDoc} |
|
| 34 | - */ |
|
| 35 | - public function getMimeType() { |
|
| 36 | - return '/audio\/mpeg/'; |
|
| 37 | - } |
|
| 32 | + /** |
|
| 33 | + * {@inheritDoc} |
|
| 34 | + */ |
|
| 35 | + public function getMimeType() { |
|
| 36 | + return '/audio\/mpeg/'; |
|
| 37 | + } |
|
| 38 | 38 | |
| 39 | - /** |
|
| 40 | - * {@inheritDoc} |
|
| 41 | - */ |
|
| 42 | - public function getThumbnail($path, $maxX, $maxY, $scalingup, $fileview) { |
|
| 43 | - $getID3 = new ID3Parser(); |
|
| 39 | + /** |
|
| 40 | + * {@inheritDoc} |
|
| 41 | + */ |
|
| 42 | + public function getThumbnail($path, $maxX, $maxY, $scalingup, $fileview) { |
|
| 43 | + $getID3 = new ID3Parser(); |
|
| 44 | 44 | |
| 45 | - $tmpPath = $fileview->toTmpFile($path); |
|
| 46 | - $tags = $getID3->analyze($tmpPath); |
|
| 47 | - unlink($tmpPath); |
|
| 48 | - $picture = isset($tags['id3v2']['APIC'][0]['data']) ? $tags['id3v2']['APIC'][0]['data'] : null; |
|
| 49 | - if(is_null($picture) && isset($tags['id3v2']['PIC'][0]['data'])) { |
|
| 50 | - $picture = $tags['id3v2']['PIC'][0]['data']; |
|
| 51 | - } |
|
| 45 | + $tmpPath = $fileview->toTmpFile($path); |
|
| 46 | + $tags = $getID3->analyze($tmpPath); |
|
| 47 | + unlink($tmpPath); |
|
| 48 | + $picture = isset($tags['id3v2']['APIC'][0]['data']) ? $tags['id3v2']['APIC'][0]['data'] : null; |
|
| 49 | + if(is_null($picture) && isset($tags['id3v2']['PIC'][0]['data'])) { |
|
| 50 | + $picture = $tags['id3v2']['PIC'][0]['data']; |
|
| 51 | + } |
|
| 52 | 52 | |
| 53 | - if(!is_null($picture)) { |
|
| 54 | - $image = new \OC_Image(); |
|
| 55 | - $image->loadFromData($picture); |
|
| 53 | + if(!is_null($picture)) { |
|
| 54 | + $image = new \OC_Image(); |
|
| 55 | + $image->loadFromData($picture); |
|
| 56 | 56 | |
| 57 | - if ($image->valid()) { |
|
| 58 | - $image->scaleDownToFit($maxX, $maxY); |
|
| 57 | + if ($image->valid()) { |
|
| 58 | + $image->scaleDownToFit($maxX, $maxY); |
|
| 59 | 59 | |
| 60 | - return $image; |
|
| 61 | - } |
|
| 62 | - } |
|
| 60 | + return $image; |
|
| 61 | + } |
|
| 62 | + } |
|
| 63 | 63 | |
| 64 | - return false; |
|
| 65 | - } |
|
| 64 | + return false; |
|
| 65 | + } |
|
| 66 | 66 | } |
@@ -46,11 +46,11 @@ |
||
| 46 | 46 | $tags = $getID3->analyze($tmpPath); |
| 47 | 47 | unlink($tmpPath); |
| 48 | 48 | $picture = isset($tags['id3v2']['APIC'][0]['data']) ? $tags['id3v2']['APIC'][0]['data'] : null; |
| 49 | - if(is_null($picture) && isset($tags['id3v2']['PIC'][0]['data'])) { |
|
| 49 | + if (is_null($picture) && isset($tags['id3v2']['PIC'][0]['data'])) { |
|
| 50 | 50 | $picture = $tags['id3v2']['PIC'][0]['data']; |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | - if(!is_null($picture)) { |
|
| 53 | + if (!is_null($picture)) { |
|
| 54 | 54 | $image = new \OC_Image(); |
| 55 | 55 | $image->loadFromData($picture); |
| 56 | 56 | |