Mercurial > hg > mgallery
comparison mgtool.php @ 268:07b2b271c12a
Some fixes to GraphicsMagick image conversion.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 19 Dec 2018 12:41:10 +0200 |
parents | a31ff7ecb785 |
children | 4a1d0f3ffa66 |
comparison
equal
deleted
inserted
replaced
267:108b354ea2ea | 268:07b2b271c12a |
---|---|
166 | 166 |
167 // Act based on image size vs. desired size and $thumb mode | 167 // Act based on image size vs. desired size and $thumb mode |
168 if ($thumb || $dim["width"] != $outDim[0] || $dim["height"] != $outDim[1]) | 168 if ($thumb || $dim["width"] != $outDim[0] || $dim["height"] != $outDim[1]) |
169 { | 169 { |
170 $img->resizeImage($outDim[0], $outDim[1], Gmagick::FILTER_LANCZOS, 1); | 170 $img->resizeImage($outDim[0], $outDim[1], Gmagick::FILTER_LANCZOS, 1); |
171 //$img->setImageExtent($outDim[0], $outDim[1]); | 171 $img->cropImage($outDim[0], $outDim[1], 0, 0); |
172 //$img->unsharpMaskImage(0, 0.5, 1, 0.05); | 172 $img->unsharpMaskImage(0, 0.5, 1, 0.05); |
173 } | 173 } |
174 } | 174 } |
175 | 175 |
176 $img->setImageDepth(8); | 176 $img->setImageDepth(8); |
177 $tfmt = strtolower($outFormat); | 177 $tfmt = strtolower($outFormat); |
196 $img->stripImage(); | 196 $img->stripImage(); |
197 // if (!empty($profiles)) | 197 // if (!empty($profiles)) |
198 // $img->profileImage("icc", $profiles); | 198 // $img->profileImage("icc", $profiles); |
199 | 199 |
200 $img->writeImage($outFilename); | 200 $img->writeImage($outFilename); |
201 $img->removeImage(); | 201 $img->destroy(); |
202 } | 202 } |
203 | 203 |
204 return TRUE; | 204 return TRUE; |
205 } | 205 } |
206 | 206 |