Skip to content
New issue

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

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

Already on GitHub? # to your account

[BUG]: Watermark offsetX does not work #16658

Closed
borisdelev opened this issue Oct 19, 2024 · 1 comment
Closed

[BUG]: Watermark offsetX does not work #16658

borisdelev opened this issue Oct 19, 2024 · 1 comment
Assignees
Labels
5.0 The issues we want to solve in the 5.0 release bug A bug report status: medium Medium

Comments

@borisdelev
Copy link
Contributor

Describe the bug:
Offset for watermark on image do not work.

This is part of zephir 5.8.0 file (https://github.com/phalcon/cphalcon/blob/master/phalcon/Image/Adapter/AbstractAdapter.zep):

    /**
     * Add a watermark to an image with the specified opacity
     *
     * @param AdapterInterface $watermark
     * @param int              $offsetX
     * @param int              $offsetY
     * @param int              $opacity
     *
     * @return AdapterInterface
     */
    public function watermark(
        <AdapterInterface> watermark,
        int offsetX = 0,
        int offsetY = 0,
        int opacity = 100
    ) -> <AdapterInterface> {
        var op, x, y;

        let x    = this->checkHighLow(
            offsetX,
            0,
            this->width - watermark->getWidth()
        );

        let y    = this->checkHighLow(
            offsetX,
            0,
            this->height - watermark->getHeight()
        );

        let op = this->checkHighLow(opacity);

        this->{"processWatermark"}(watermark, x, y, opacity);

        return this;
    }

... so offsetY is not used.
Well... it is a little mistake.

Greetings

@borisdelev borisdelev added bug A bug report status: unverified Unverified labels Oct 19, 2024
@niden niden mentioned this issue Oct 20, 2024
5 tasks
@niden niden added status: medium Medium 5.0 The issues we want to solve in the 5.0 release and removed status: unverified Unverified labels Oct 20, 2024
@niden niden self-assigned this Oct 20, 2024
@niden
Copy link
Member

niden commented Oct 20, 2024

Resolved in #16659

Thank you @borisdelev

@niden niden closed this as completed Oct 20, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
5.0 The issues we want to solve in the 5.0 release bug A bug report status: medium Medium
Projects
Status: Implemented
Development

No branches or pull requests

2 participants