diff options
Diffstat (limited to 'model/Image.php')
-rw-r--r-- | model/Image.php | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/model/Image.php b/model/Image.php index 61f25c6..1cc0e22 100644 --- a/model/Image.php +++ b/model/Image.php | |||
@@ -67,7 +67,7 @@ class Image | |||
67 | if($imageLibrary == 'imagick') | 67 | if($imageLibrary == 'imagick') |
68 | { | 68 | { |
69 | $Image = new Imagick($this->path . $_FILES['upload']['name']); | 69 | $Image = new Imagick($this->path . $_FILES['upload']['name']); |
70 | 70 | ||
71 | $source = $Image->getImageGeometry(); | 71 | $source = $Image->getImageGeometry(); |
72 | if($source['width'] > $largeur) | 72 | if($source['width'] > $largeur) |
73 | { | 73 | { |
@@ -82,17 +82,13 @@ class Image | |||
82 | { | 82 | { |
83 | // cette fonction fonctionne pour tous les formats | 83 | // cette fonction fonctionne pour tous les formats |
84 | $source = imagecreatefromstring(file_get_contents($this->path . $_FILES['upload']['name'])); | 84 | $source = imagecreatefromstring(file_get_contents($this->path . $_FILES['upload']['name'])); |
85 | |||
86 | $nomMiniImage = $this->pathMini . $this->pathInfos['filename'] . '-mini.jpg'; | 85 | $nomMiniImage = $this->pathMini . $this->pathInfos['filename'] . '-mini.jpg'; |
87 | |||
88 | $forme = imagesy($source) / imagesx($source); | 86 | $forme = imagesy($source) / imagesx($source); |
89 | var_dump($forme); | ||
90 | 87 | ||
91 | if(imagesx($source) > $largeur) | 88 | if(imagesx($source) > $largeur) |
92 | { | 89 | { |
93 | // créer un rectangle noir | 90 | // créer un rectangle noir |
94 | $destination = imagecreatetruecolor($largeur, $largeur * $forme); | 91 | $destination = imagecreatetruecolor($largeur, $largeur * $forme); |
95 | //var_dump($destination); | ||
96 | 92 | ||
97 | // sélectionne un rectangle dans l'image source | 93 | // sélectionne un rectangle dans l'image source |
98 | // et le place dans un rectangle dans la nouvelle | 94 | // et le place dans un rectangle dans la nouvelle |