@@ -194,7 +194,8 @@ protected function prepareZoomBaseImages(string $image_path, string $out_path):v
194
194
// resizeImage - works slower but offers better quality
195
195
: $ il ->resizeImage ($ w , $ h , $ this ->options ->resize_filter , $ this ->options ->resize_blur );
196
196
197
- $ this ->saveImage ($ il , $ base_image );
197
+ // save without optimizing
198
+ $ this ->saveImage ($ il , $ base_image , false );
198
199
199
200
if ($ start ){
200
201
$ this ->clearImage ($ im );
@@ -265,7 +266,7 @@ protected function createTilesForZoom(Imagick $im, int $zoom, string $out_path,
265
266
$ ti ->extentImage ($ ts , $ ts , 0 , $ th );
266
267
}
267
268
268
- $ this ->saveImage ($ ti , $ tile , $ optimizer );
269
+ $ this ->saveImage ($ ti , $ tile , true );
269
270
$ this ->clearImage ($ ti );
270
271
}
271
272
@@ -280,13 +281,14 @@ protected function createTilesForZoom(Imagick $im, int $zoom, string $out_path,
280
281
/**
281
282
* save image in to destination
282
283
*
283
- * @param Imagick $image
284
- * @param string $dest full path with file name
284
+ * @param Imagick $image
285
+ * @param string $dest full path with file name
286
+ * @param bool $optimize
285
287
*
286
288
* @return void
287
289
* @throws \chillerlan\Imagetiler\ImagetilerException
288
290
*/
289
- protected function saveImage (Imagick $ image , string $ dest ):void {
291
+ protected function saveImage (Imagick $ image , string $ dest, bool $ optimize ):void {
290
292
$ dir = dirname ($ dest );
291
293
292
294
if (!is_dir ($ dir )){
@@ -304,7 +306,7 @@ protected function saveImage(Imagick $image, string $dest):void{
304
306
throw new ImagetilerException ('cannot save image ' .$ dest );
305
307
}
306
308
307
- if ($ this ->options ->optimize_output && $ this ->optimizer instanceof Optimizer){
309
+ if ($ this ->options ->optimize_output && $ optimize && $ this ->optimizer instanceof Optimizer){
308
310
$ this ->optimizer ->optimize ($ dest );
309
311
}
310
312
0 commit comments