1 | <?php |
||
11 | class Image extends File { |
||
12 | |||
13 | static $phpThumbLib = '/../../../../lib/thumb/ThumbLib.inc.php'; |
||
14 | |||
15 | const QUALITY = 70; |
||
16 | const MAX_HEIGHT = 900; |
||
17 | const MAX_WIDTH = 1200; |
||
18 | |||
19 | protected static $validExtensions = ['jpg', 'jpeg', 'gif', 'png']; |
||
20 | |||
21 | /* @overwrite */ |
||
22 | |||
23 | function upload($newName = '') { |
||
30 | |||
31 | /** |
||
32 | * Gera a miniatura |
||
33 | * @return string Retorna o caminho da thumb |
||
34 | * @param int $width largura |
||
35 | * @param int $height altura |
||
36 | * @param boolean $mode modo de corte |
||
37 | */ |
||
38 | function showThumb($width = 100, $height = 100, $mode = 'normal') { |
||
41 | |||
42 | /** |
||
43 | * Cria uma miniatura da imagem |
||
44 | * @return string |
||
45 | */ |
||
46 | function saveThumb() { |
||
56 | |||
57 | /** |
||
58 | * Inclui bibliotecas necessárias |
||
59 | * @return string |
||
60 | */ |
||
61 | protected function includeLibrary() { |
||
71 | |||
72 | public function __toString() { |
||
79 | |||
80 | public function getFullName() { |
||
87 | |||
88 | public function removeOld() { |
||
92 | |||
93 | /** Limpa imagens em cache */ |
||
94 | public function clearCache() { |
||
98 | |||
99 | } |
||
100 |
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.