Last active
September 22, 2017 13:14
-
-
Save rslhdyt/6f920ab19ad9f5fbf304bcb12d4f5290 to your computer and use it in GitHub Desktop.
[Intervention Image] Apply multiple watermark to image
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// ..... | |
$img = Image::make('images/picture.jpg'); | |
$watermark = Image::make('images/watermark.png'); | |
$x = 0; | |
while ($x < $img->width()) { | |
$y = 0; | |
while($y < $img->height()) { | |
$img->insert('images/watermark.png', 'top-left', $x, $y); | |
$y += $watermark->height(); | |
} | |
$x += $watermark->width(); | |
} | |
$img->save(public_path('storage/' . $thumbnailFile), 60); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment