comparison mgtool.php @ 303:6bb434968623

Add new MG_STR_LC setting type, which is string but automatically lowercased.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 03 Apr 2020 16:22:51 +0300
parents b72da68991ed
children da150fe627b6
comparison
equal deleted inserted replaced
302:f8d812d3194f 303:6bb434968623
140 $img->unsharpMaskImage(0, 0.5, 1, 0.05); 140 $img->unsharpMaskImage(0, 0.5, 1, 0.05);
141 } 141 }
142 } 142 }
143 143
144 $img->setImageDepth(8); 144 $img->setImageDepth(8);
145 $tfmt = strtolower($outFormat); 145 switch ($outFormat)
146 switch ($tfmt)
147 { 146 {
148 case "jpeg": 147 case "jpeg":
149 $img->setFormat("JPEG"); 148 $img->setFormat("JPEG");
150 $img->setImageCompression(Imagick::COMPRESSION_JPEG); 149 $img->setImageCompression(Imagick::COMPRESSION_JPEG);
151 break; 150 break;
154 $img->setFormat("WEBP"); 153 $img->setFormat("WEBP");
155 $img->setOption('webp:method', '6'); 154 $img->setOption('webp:method', '6');
156 break; 155 break;
157 156
158 default: 157 default:
159 return mgError("Unsupported MGallery med/tn format '".$tfmt."'.\n"); 158 return mgError("Unsupported MGallery med/tn format '".$outFormat."'.\n");
160 } 159 }
161 160
162 $img->setImageCompressionQuality($outQuality); 161 $img->setImageCompressionQuality($outQuality);
163 162
164 $img->stripImage(); 163 $img->stripImage();
216 $img->unsharpMaskImage(0, 0.5, 1, 0.05); 215 $img->unsharpMaskImage(0, 0.5, 1, 0.05);
217 } 216 }
218 } 217 }
219 218
220 $img->setImageDepth(8); 219 $img->setImageDepth(8);
221 $tfmt = strtolower($outFormat); 220 switch ($outFormat)
222 switch ($tfmt)
223 { 221 {
224 case "jpeg": 222 case "jpeg":
225 $img->setFormat("JPEG"); 223 $img->setFormat("JPEG");
226 $img->setImageCompression(Gmagick::COMPRESSION_JPEG); 224 $img->setImageCompression(Gmagick::COMPRESSION_JPEG);
227 break; 225 break;
230 $img->setFormat("WEBP"); 228 $img->setFormat("WEBP");
231 //$img->setOption('webp:method', '6'); 229 //$img->setOption('webp:method', '6');
232 break; 230 break;
233 231
234 default: 232 default:
235 return mgError("Unsupported MGallery med/tn format '".$tfmt."'.\n"); 233 return mgError("Unsupported MGallery med/tn format '".$outFormat."'.\n");
236 } 234 }
237 235
238 $img->setCompressionQuality($outQuality); 236 $img->setCompressionQuality($outQuality);
239 237
240 $img->stripImage(); 238 $img->stripImage();