diff options
Diffstat (limited to 'model/Image.php')
-rw-r--r-- | model/Image.php | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/model/Image.php b/model/Image.php index 59665e9..61f25c6 100644 --- a/model/Image.php +++ b/model/Image.php | |||
@@ -67,8 +67,14 @@ 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 | // 0 signifie qu'on conserve les proportions | 70 | |
71 | $Image->thumbnailImage($largeur, 0); | 71 | $source = $Image->getImageGeometry(); |
72 | if($source['width'] > $largeur) | ||
73 | { | ||
74 | // 0 signifie qu'on conserve les proportions | ||
75 | $Image->thumbnailImage($largeur, 0); | ||
76 | } | ||
77 | |||
72 | // écriture dans un fichier | 78 | // écriture dans un fichier |
73 | $Image->writeImage($this->pathMini . $this->pathInfos['filename'] . '-mini.' . $this->pathInfos['extension']); | 79 | $Image->writeImage($this->pathMini . $this->pathInfos['filename'] . '-mini.' . $this->pathInfos['extension']); |
74 | } | 80 | } |