Skip to content

Commit

Permalink
store images always as jpg with 80% quality/compression
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasvielmetter committed Oct 26, 2019
1 parent dac6f4d commit f0a2eab
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/WrkLst/DocxMustache/DocImage.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ public function ResampleImage($parent, $imgs, $k, $data, $dpi = 72)
\Storage::disk($parent->storageDisk)->put($parent->local_path.'word/media/'.$imgs[$k]['img_file_src'], $data);

//rework img to new size and jpg format
$img_rework = \Image::make($parent->StoragePath($parent->local_path.'word/media/'.$imgs[$k]['img_file_src']));
$img_rework = \Image::make($parent->StoragePath($parent->local_path.'word/media/'.$imgs[$k]['img_file_src']))->encode('jpg', 80);
if ($dpi != 72) {
$img_rework2 = \Image::make($parent->StoragePath($parent->local_path.'word/media/'.$imgs[$k]['img_file_src']));
$img_rework2 = \Image::make($parent->StoragePath($parent->local_path.'word/media/'.$imgs[$k]['img_file_src']))->encode('jpg', 80);
}

$imgWidth = $img_rework->width();
Expand Down

0 comments on commit f0a2eab

Please sign in to comment.