Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
die_coolen_jungs
our_own_cloud_project
Commits
ec7b55f5
Commit
ec7b55f5
authored
Nov 28, 2014
by
Joas Schilling
Browse files
Split bitmap providers into one per file
parent
3ec42ad5
Changes
7
Show whitespace changes
Inline
Side-by-side
lib/private/preview.php
View file @
ec7b55f5
...
...
@@ -16,8 +16,6 @@ namespace OC;
use
OC\Preview\Provider
;
use
OCP\Files\NotFoundException
;
require_once
'preview/bitmap.php'
;
class
Preview
{
//the thumbnail folder
const
THUMBNAILS_FOLDER
=
'thumbnails'
;
...
...
lib/private/preview/bitmap.php
View file @
ec7b55f5
...
...
@@ -5,16 +5,13 @@
* later.
* See the COPYING-README file.
*/
namespace
OC\Preview
;
use
Imagick
;
class
Bitmap
extends
Provider
{
public
function
getMimeType
()
{
return
null
;
}
namespace
OC\Preview
;
abstract
class
Bitmap
extends
Provider
{
/**
* {@inheritDoc}
*/
public
function
getThumbnail
(
$path
,
$maxX
,
$maxY
,
$scalingup
,
$fileview
)
{
$tmpPath
=
$fileview
->
toTmpFile
(
$path
);
...
...
@@ -22,7 +19,7 @@ use Imagick;
try
{
// Layer 0 contains either the bitmap or
// a flat representation of all vector layers
$bp
=
new
Imagick
(
$tmpPath
.
'[0]'
);
$bp
=
new
\
Imagick
(
$tmpPath
.
'[0]'
);
$bp
->
setImageFormat
(
'png'
);
}
catch
(
\
Exception
$e
)
{
...
...
@@ -37,49 +34,4 @@ use Imagick;
//check if image object is valid
return
$image
->
valid
()
?
$image
:
false
;
}
}
//.pdf
class
PDF
extends
Bitmap
{
public
function
getMimeType
()
{
return
'/application\/pdf/'
;
}
}
//.tiff
class
TIFF
extends
Bitmap
{
public
function
getMimeType
()
{
return
'/image\/tiff/'
;
}
}
//.ai
class
Illustrator
extends
Bitmap
{
public
function
getMimeType
()
{
return
'/application\/illustrator/'
;
}
}
//.eps
class
Postscript
extends
Bitmap
{
public
function
getMimeType
()
{
return
'/application\/postscript/'
;
}
}
//.psd
class
Photoshop
extends
Bitmap
{
public
function
getMimeType
()
{
return
'/application\/x-photoshop/'
;
}
}
}
lib/private/preview/illustrator.php
0 → 100644
View file @
ec7b55f5
<?php
/**
* Copyright (c) 2013-2014 Georg Ehrke georg@ownCloud.com
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
namespace
OC\Preview
;
//.ai
class
Illustrator
extends
Bitmap
{
/**
* {@inheritDoc}
*/
public
function
getMimeType
()
{
return
'/application\/illustrator/'
;
}
}
lib/private/preview/pdf.php
0 → 100644
View file @
ec7b55f5
<?php
/**
* Copyright (c) 2013-2014 Georg Ehrke georg@ownCloud.com
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
namespace
OC\Preview
;
//.pdf
class
PDF
extends
Bitmap
{
/**
* {@inheritDoc}
*/
public
function
getMimeType
()
{
return
'/application\/pdf/'
;
}
}
lib/private/preview/photoshop.php
0 → 100644
View file @
ec7b55f5
<?php
/**
* Copyright (c) 2013-2014 Georg Ehrke georg@ownCloud.com
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
namespace
OC\Preview
;
//.psd
class
Photoshop
extends
Bitmap
{
/**
* {@inheritDoc}
*/
public
function
getMimeType
()
{
return
'/application\/x-photoshop/'
;
}
}
lib/private/preview/postscript.php
0 → 100644
View file @
ec7b55f5
<?php
/**
* Copyright (c) 2013-2014 Georg Ehrke georg@ownCloud.com
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
namespace
OC\Preview
;
//.eps
class
Postscript
extends
Bitmap
{
/**
* {@inheritDoc}
*/
public
function
getMimeType
()
{
return
'/application\/postscript/'
;
}
}
lib/private/preview/tiff.php
0 → 100644
View file @
ec7b55f5
<?php
/**
* Copyright (c) 2013-2014 Georg Ehrke georg@ownCloud.com
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
namespace
OC\Preview
;
//.tiff
class
TIFF
extends
Bitmap
{
/**
* {@inheritDoc}
*/
public
function
getMimeType
()
{
return
'/image\/tiff/'
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment