summaryrefslogtreecommitdiffstats
path: root/lib/private/preview
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/preview')
-rw-r--r--lib/private/preview/image.php4
-rw-r--r--lib/private/preview/movies.php3
-rw-r--r--lib/private/preview/mp3.php6
-rw-r--r--lib/private/preview/office-cl.php3
-rw-r--r--lib/private/preview/office-fallback.php3
5 files changed, 12 insertions, 7 deletions
diff --git a/lib/private/preview/image.php b/lib/private/preview/image.php
index 9aec967282d..84343df2608 100644
--- a/lib/private/preview/image.php
+++ b/lib/private/preview/image.php
@@ -21,11 +21,11 @@ class Image extends Provider {
return false;
}
+ $image = new \OC_Image();
//check if file is encrypted
if($fileInfo['encrypted'] === true) {
- $image = new \OC_Image(stream_get_contents($fileview->fopen($path, 'r')));
+ $image->loadFromData(stream_get_contents($fileview->fopen($path, 'r')));
}else{
- $image = new \OC_Image();
$image->loadFromFile($fileview->getLocalFile($path));
}
diff --git a/lib/private/preview/movies.php b/lib/private/preview/movies.php
index 7e012ec44aa..28f130f7506 100644
--- a/lib/private/preview/movies.php
+++ b/lib/private/preview/movies.php
@@ -69,7 +69,8 @@ if (!\OC_Util::runningOnWindows()) {
unlink($absPath);
if ($returnCode === 0) {
- $image = new \OC_Image($tmpPath);
+ $image = new \OC_Image();
+ $image->loadFromFile($tmpPath);
unlink($tmpPath);
return $image->valid() ? $image : false;
}
diff --git a/lib/private/preview/mp3.php b/lib/private/preview/mp3.php
index 1eed566315c..3fc0ab0490c 100644
--- a/lib/private/preview/mp3.php
+++ b/lib/private/preview/mp3.php
@@ -25,7 +25,8 @@ class MP3 extends Provider {
if(isset($tags['id3v2']['APIC'][0]['data'])) {
$picture = @$tags['id3v2']['APIC'][0]['data'];
unlink($tmpPath);
- $image = new \OC_Image($picture);
+ $image = new \OC_Image();
+ $image->loadFromData($picture);
return $image->valid() ? $image : $this->getNoCoverThumbnail();
}
@@ -39,7 +40,8 @@ class MP3 extends Provider {
return false;
}
- $image = new \OC_Image($icon);
+ $image = new \OC_Image();
+ $image->loadFromFile($icon);
return $image->valid() ? $image : false;
}
diff --git a/lib/private/preview/office-cl.php b/lib/private/preview/office-cl.php
index 8f2e06c050b..b11fed13ba1 100644
--- a/lib/private/preview/office-cl.php
+++ b/lib/private/preview/office-cl.php
@@ -48,7 +48,8 @@ if (!\OC_Util::runningOnWindows()) {
return false;
}
- $image = new \OC_Image($pdf);
+ $image = new \OC_Image();
+ $image->loadFromData($pdf);
unlink($absPath);
unlink($absPath . '.pdf');
diff --git a/lib/private/preview/office-fallback.php b/lib/private/preview/office-fallback.php
index e69ab0ab8cb..f184b3149d5 100644
--- a/lib/private/preview/office-fallback.php
+++ b/lib/private/preview/office-fallback.php
@@ -80,7 +80,8 @@ class MSOfficeExcel extends Provider {
unlink($absPath);
unlink($tmpPath);
- $image = new \OC_Image($pdf);
+ $image = new \OC_Image();
+ $image->loadFromData($pdf);
return $image->valid() ? $image : false;
}