Created
July 6, 2012 09:50
-
-
Save tristanlins/3059292 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface Media | |
{ | |
Media static get(String file); | |
bool isImage(); | |
bool isPDF(); | |
bool isVideo(); | |
bool isAudio(); | |
bool hasThumb(); | |
Media getThumb(Size size); | |
bool isResizeable(); | |
Media resize(Size size, CropMode cropMode); | |
Size getSize(); | |
int getFilesize(); | |
... | |
// usw. | |
} | |
<?php | |
$objImage = Media::get('tl_files/images/Wallpaper.jpg'); | |
$objThumb = $objImage->getThump(new Size(100, 100)); | |
// $objThumb -> Thumbnail von Wallpaper.jpg | |
?> | |
<?php | |
$objVideo = Media::get('tl_files/videos/imagevideo.mp4'); | |
$objThumb = $objVideo->getThumb(new Size(100, 100), 90); | |
// $objThumb -> Thumbnail von imagevideo.mp4 bei Sekunde 90 | |
?> | |
<?php | |
$objPDF = Media::get('tl_files/pdf/brochure.pdf'); | |
$objThumb = $objPDF->getThumb(new Size(100, 100), 2); | |
// $objThumb -> Thumbnail von brochure.pdf Seite 2 | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment