Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[enh] add a way to use watermark w/o thumbnail #358

Open
Philosoft opened this issue Dec 22, 2016 · 1 comment
Open

[enh] add a way to use watermark w/o thumbnail #358

Philosoft opened this issue Dec 22, 2016 · 1 comment
Labels

Comments

@Philosoft
Copy link
Contributor

No description provided.

@Philosoft
Copy link
Contributor Author

Philosoft commented Dec 23, 2016

here is my proposal:

<?php

namespace app\modules\image\actions\helpers;

use app\modules\image\models\ThumbnailWatermark;

class ImageHelper
{
    public static function mergeWithWatermark($imageSrc, $watermarkSrc, $watermarkPosition)
    {
        return "/files/" . ThumbnailWatermark::createWatermark(
            (object)["thumb_path" => $imageSrc],
            (object)[
                "watermark_path" => $watermarkSrc,
                "position" => $watermarkPosition
            ]
        );
    }
}

$imageSrc and $watermarkSrc must be path relative to @webroot/files/

Additional ideas:

  • copy & pase code from createWatermark
  • extend it with watermark_id (instead of $watermarkSrc) support

@fps01 @bethrezen this is a review request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant