Mercurial > hg > mgallery
comparison mgtool.php @ 284:403f2e1e5e79
Indentation.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Fri, 17 May 2019 03:15:53 +0300 |
parents | 1bcaab2d3e6a |
children | 878d2a772fd6 |
comparison
equal
deleted
inserted
replaced
283:1bcaab2d3e6a | 284:403f2e1e5e79 |
---|---|
151 } | 151 } |
152 | 152 |
153 if ($img === FALSE) | 153 if ($img === FALSE) |
154 return mgError("GraphicsMagick could not digest '".$inFilename."'.\n"); | 154 return mgError("GraphicsMagick could not digest '".$inFilename."'.\n"); |
155 | 155 |
156 // $profiles = $img->getImageProfile("icc"); | 156 //$profiles = $img->getImageProfile("icc"); |
157 // $img->setImageDepth(16); | 157 //$img->setImageDepth(16); |
158 // $img->setImageColorspace(Gmagick::COLORSPACE_SRGB); | 158 //$img->setImageColorspace(Gmagick::COLORSPACE_SRGB); |
159 | 159 |
160 if ($outDim !== FALSE) | 160 if ($outDim !== FALSE) |
161 { | 161 { |
162 // Get dimensions, setup background | 162 // Get dimensions, setup background |
163 $dim = $img->getImageGeometry(); | 163 $dim = $img->getImageGeometry(); |
193 $img->setImageCompression(Gmagick::COMPRESSION_JPEG); | 193 $img->setImageCompression(Gmagick::COMPRESSION_JPEG); |
194 break; | 194 break; |
195 | 195 |
196 case "webp": | 196 case "webp": |
197 $img->setFormat("WEBP"); | 197 $img->setFormat("WEBP"); |
198 // $img->setOption('webp:method', '6'); | 198 //$img->setOption('webp:method', '6'); |
199 break; | 199 break; |
200 | 200 |
201 default: | 201 default: |
202 return mgError("Unsupported MGallery med/tn format '".$tfmt."'.\n"); | 202 return mgError("Unsupported MGallery med/tn format '".$tfmt."'.\n"); |
203 } | 203 } |
204 | 204 |
205 $img->setCompressionQuality($outQuality); | 205 $img->setCompressionQuality($outQuality); |
206 | 206 |
207 $img->stripImage(); | 207 $img->stripImage(); |
208 // if (!empty($profiles)) | 208 //if (!empty($profiles)) |
209 // $img->profileImage("icc", $profiles); | 209 // $img->profileImage("icc", $profiles); |
210 | 210 |
211 $img->writeImage($outFilename); | 211 $img->writeImage($outFilename); |
212 $img->destroy(); | 212 $img->destroy(); |
213 } | 213 } |
214 | 214 |