Magento 2.2.x: Watermark only large/fullscreen image?












0














If I set only the "base" image watermark in the admin panel, it watermarks not only the fullscreen image but also the "medium" image used in the main product view. On the full image, the watermark is the correct size but on the medium image, the watermark covers about a third of the product image.



How can I either stop the medium image being watermarked or allow the watermark to be sized proportionally to the product image size? i.e. by setting a heightXwidth percentage instead of a pixel value.



Also, my watermark has a white background which gets converted to transparent - this is not desirable for me.



TIA.










share|improve this question



























    0














    If I set only the "base" image watermark in the admin panel, it watermarks not only the fullscreen image but also the "medium" image used in the main product view. On the full image, the watermark is the correct size but on the medium image, the watermark covers about a third of the product image.



    How can I either stop the medium image being watermarked or allow the watermark to be sized proportionally to the product image size? i.e. by setting a heightXwidth percentage instead of a pixel value.



    Also, my watermark has a white background which gets converted to transparent - this is not desirable for me.



    TIA.










    share|improve this question

























      0












      0








      0







      If I set only the "base" image watermark in the admin panel, it watermarks not only the fullscreen image but also the "medium" image used in the main product view. On the full image, the watermark is the correct size but on the medium image, the watermark covers about a third of the product image.



      How can I either stop the medium image being watermarked or allow the watermark to be sized proportionally to the product image size? i.e. by setting a heightXwidth percentage instead of a pixel value.



      Also, my watermark has a white background which gets converted to transparent - this is not desirable for me.



      TIA.










      share|improve this question













      If I set only the "base" image watermark in the admin panel, it watermarks not only the fullscreen image but also the "medium" image used in the main product view. On the full image, the watermark is the correct size but on the medium image, the watermark covers about a third of the product image.



      How can I either stop the medium image being watermarked or allow the watermark to be sized proportionally to the product image size? i.e. by setting a heightXwidth percentage instead of a pixel value.



      Also, my watermark has a white background which gets converted to transparent - this is not desirable for me.



      TIA.







      magento2.2 image watermark






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jun 22 '18 at 16:32









      nedge2knedge2k

      12




      12






















          1 Answer
          1






          active

          oldest

          votes


















          0














          There is a bug in Magento 2.2.5 related to transparency: https://github.com/magento/magento2/issues/16929



          As a workaround you can create a patch or update to 2.2.7



          diff --git a/Image/Adapter/Gd2.php b/Image/Adapter/Gd2.php
          index 33d7376..e04ecc3 100644
          --- a/Image/Adapter/Gd2.php
          +++ b/Image/Adapter/Gd2.php
          @@ -425,7 +425,6 @@ class Gd2 extends MagentoFrameworkImageAdapterAbstractAdapter
          $col = imagecolorallocate($newWatermark, 255, 255, 255);
          imagecolortransparent($newWatermark, $col);
          imagefilledrectangle($newWatermark, 0, 0, $this->getWatermarkWidth(), $this->getWatermarkHeight(), $col);
          - imagealphablending($newWatermark, true);
          imagesavealpha($newWatermark, true);
          imagecopyresampled(
          $newWatermark,
          @@ -450,7 +449,6 @@ class Gd2 extends MagentoFrameworkImageAdapterAbstractAdapter
          $col = imagecolorallocate($newWatermark, 255, 255, 255);
          imagecolortransparent($newWatermark, $col);
          imagefilledrectangle($newWatermark, 0, 0, $this->_imageSrcWidth, $this->_imageSrcHeight, $col);
          - imagealphablending($newWatermark, true);
          imagesavealpha($newWatermark, true);
          imagecopyresampled(
          $newWatermark,
          --
          2.17.1





          share|improve this answer





















            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "479"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f231075%2fmagento-2-2-x-watermark-only-large-fullscreen-image%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            There is a bug in Magento 2.2.5 related to transparency: https://github.com/magento/magento2/issues/16929



            As a workaround you can create a patch or update to 2.2.7



            diff --git a/Image/Adapter/Gd2.php b/Image/Adapter/Gd2.php
            index 33d7376..e04ecc3 100644
            --- a/Image/Adapter/Gd2.php
            +++ b/Image/Adapter/Gd2.php
            @@ -425,7 +425,6 @@ class Gd2 extends MagentoFrameworkImageAdapterAbstractAdapter
            $col = imagecolorallocate($newWatermark, 255, 255, 255);
            imagecolortransparent($newWatermark, $col);
            imagefilledrectangle($newWatermark, 0, 0, $this->getWatermarkWidth(), $this->getWatermarkHeight(), $col);
            - imagealphablending($newWatermark, true);
            imagesavealpha($newWatermark, true);
            imagecopyresampled(
            $newWatermark,
            @@ -450,7 +449,6 @@ class Gd2 extends MagentoFrameworkImageAdapterAbstractAdapter
            $col = imagecolorallocate($newWatermark, 255, 255, 255);
            imagecolortransparent($newWatermark, $col);
            imagefilledrectangle($newWatermark, 0, 0, $this->_imageSrcWidth, $this->_imageSrcHeight, $col);
            - imagealphablending($newWatermark, true);
            imagesavealpha($newWatermark, true);
            imagecopyresampled(
            $newWatermark,
            --
            2.17.1





            share|improve this answer


























              0














              There is a bug in Magento 2.2.5 related to transparency: https://github.com/magento/magento2/issues/16929



              As a workaround you can create a patch or update to 2.2.7



              diff --git a/Image/Adapter/Gd2.php b/Image/Adapter/Gd2.php
              index 33d7376..e04ecc3 100644
              --- a/Image/Adapter/Gd2.php
              +++ b/Image/Adapter/Gd2.php
              @@ -425,7 +425,6 @@ class Gd2 extends MagentoFrameworkImageAdapterAbstractAdapter
              $col = imagecolorallocate($newWatermark, 255, 255, 255);
              imagecolortransparent($newWatermark, $col);
              imagefilledrectangle($newWatermark, 0, 0, $this->getWatermarkWidth(), $this->getWatermarkHeight(), $col);
              - imagealphablending($newWatermark, true);
              imagesavealpha($newWatermark, true);
              imagecopyresampled(
              $newWatermark,
              @@ -450,7 +449,6 @@ class Gd2 extends MagentoFrameworkImageAdapterAbstractAdapter
              $col = imagecolorallocate($newWatermark, 255, 255, 255);
              imagecolortransparent($newWatermark, $col);
              imagefilledrectangle($newWatermark, 0, 0, $this->_imageSrcWidth, $this->_imageSrcHeight, $col);
              - imagealphablending($newWatermark, true);
              imagesavealpha($newWatermark, true);
              imagecopyresampled(
              $newWatermark,
              --
              2.17.1





              share|improve this answer
























                0












                0








                0






                There is a bug in Magento 2.2.5 related to transparency: https://github.com/magento/magento2/issues/16929



                As a workaround you can create a patch or update to 2.2.7



                diff --git a/Image/Adapter/Gd2.php b/Image/Adapter/Gd2.php
                index 33d7376..e04ecc3 100644
                --- a/Image/Adapter/Gd2.php
                +++ b/Image/Adapter/Gd2.php
                @@ -425,7 +425,6 @@ class Gd2 extends MagentoFrameworkImageAdapterAbstractAdapter
                $col = imagecolorallocate($newWatermark, 255, 255, 255);
                imagecolortransparent($newWatermark, $col);
                imagefilledrectangle($newWatermark, 0, 0, $this->getWatermarkWidth(), $this->getWatermarkHeight(), $col);
                - imagealphablending($newWatermark, true);
                imagesavealpha($newWatermark, true);
                imagecopyresampled(
                $newWatermark,
                @@ -450,7 +449,6 @@ class Gd2 extends MagentoFrameworkImageAdapterAbstractAdapter
                $col = imagecolorallocate($newWatermark, 255, 255, 255);
                imagecolortransparent($newWatermark, $col);
                imagefilledrectangle($newWatermark, 0, 0, $this->_imageSrcWidth, $this->_imageSrcHeight, $col);
                - imagealphablending($newWatermark, true);
                imagesavealpha($newWatermark, true);
                imagecopyresampled(
                $newWatermark,
                --
                2.17.1





                share|improve this answer












                There is a bug in Magento 2.2.5 related to transparency: https://github.com/magento/magento2/issues/16929



                As a workaround you can create a patch or update to 2.2.7



                diff --git a/Image/Adapter/Gd2.php b/Image/Adapter/Gd2.php
                index 33d7376..e04ecc3 100644
                --- a/Image/Adapter/Gd2.php
                +++ b/Image/Adapter/Gd2.php
                @@ -425,7 +425,6 @@ class Gd2 extends MagentoFrameworkImageAdapterAbstractAdapter
                $col = imagecolorallocate($newWatermark, 255, 255, 255);
                imagecolortransparent($newWatermark, $col);
                imagefilledrectangle($newWatermark, 0, 0, $this->getWatermarkWidth(), $this->getWatermarkHeight(), $col);
                - imagealphablending($newWatermark, true);
                imagesavealpha($newWatermark, true);
                imagecopyresampled(
                $newWatermark,
                @@ -450,7 +449,6 @@ class Gd2 extends MagentoFrameworkImageAdapterAbstractAdapter
                $col = imagecolorallocate($newWatermark, 255, 255, 255);
                imagecolortransparent($newWatermark, $col);
                imagefilledrectangle($newWatermark, 0, 0, $this->_imageSrcWidth, $this->_imageSrcHeight, $col);
                - imagealphablending($newWatermark, true);
                imagesavealpha($newWatermark, true);
                imagecopyresampled(
                $newWatermark,
                --
                2.17.1






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered yesterday









                Stevie-Ray HartogStevie-Ray Hartog

                134




                134






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Magento Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.





                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                    Please pay close attention to the following guidance:


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f231075%2fmagento-2-2-x-watermark-only-large-fullscreen-image%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    An IMO inspired problem

                    Management

                    Has there ever been an instance of an active nuclear power plant within or near a war zone?