How to resize the header logo of magento?












2















How to resize the header logo of magento??
Please reply soon.. I am Working now



<img src="<?php echo $this->getLogoSrc()->resize() ?>" alt="<?php echo $this->getLogoAlt() ?>" />









share|improve this question





























    2















    How to resize the header logo of magento??
    Please reply soon.. I am Working now



    <img src="<?php echo $this->getLogoSrc()->resize() ?>" alt="<?php echo $this->getLogoAlt() ?>" />









    share|improve this question



























      2












      2








      2


      1






      How to resize the header logo of magento??
      Please reply soon.. I am Working now



      <img src="<?php echo $this->getLogoSrc()->resize() ?>" alt="<?php echo $this->getLogoAlt() ?>" />









      share|improve this question
















      How to resize the header logo of magento??
      Please reply soon.. I am Working now



      <img src="<?php echo $this->getLogoSrc()->resize() ?>" alt="<?php echo $this->getLogoAlt() ?>" />






      magento-1.7






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Apr 10 '14 at 13:26









      Marius

      164k28312662




      164k28312662










      asked Apr 10 '14 at 13:26









      ArifArif

      1624




      1624






















          6 Answers
          6






          active

          oldest

          votes


















          2














          The best way to resize an image in magento isVarien_Image



          Follow the below code for resize image
          $image = new Varien_Image('/full/fs/path/to/image.jpg');

          // you cannot use method chaining with Varien_Image
          $image->constrainOnly(false);
          $image->keepFrame(true);
          // avoid black borders by setting background colour
          $image->backgroundColor(array(255,255,255));
          $image->keepAspectRatio(true);
          $image->resize(216, 139);
          $image->save('/full/fs/path/to/save/to.jpg');


          more clearly



          $_imageUrl = logo die path;
          $imageResized = Mage::getBaseDir(‘media’).DS.“resized”.$image;
          if (!file_exists($imageResized)&&file_exists($_imageUrl)) :
          $imageObj = new Varien_Image($_imageUrl);
          $imageObj->constrainOnly(TRUE);
          $imageObj->keepAspectRatio(TRUE);
          $imageObj->keepFrame(FALSE);
          $imageObj->resize(140, 140);
          $imageObj->save($imageResized);
          endif;





          share|improve this answer































            1














            Not possible.

            Either you add width and height attributes on the <img /> tag, or you put as a logo an image with exactly your desired dimensions. (You can do both).






            share|improve this answer
























            • is there any magento function to solve it???

              – Arif
              Apr 10 '14 at 13:35






            • 2





              Read my answer carefully. It starts with 'not possible'. Of course I'm being a little drastic. In theory it is possible but not with what Magento offers. You will have to code everything your self and it's not easy.

              – Marius
              Apr 10 '14 at 13:44



















            0














            The Best Way to do it is With CSS, More Easy and More Clean..



            If you want a variable image, you can use %..



            .logo img{ width: 100%;height: 100%}






            share|improve this answer































              0















              1. Find logo.phtml and add an id to tag.

              2. Then add a custom css specifying width and height you want.






              share|improve this answer

































                0














                I have an issue with my logo, I followed normal steps:
                1. Magento Admin > Content > Configuration > [store] > Header > Logo Image [Upload]
                2. Set Logo Image Width and Height, just fill in numbers, no need to use 'px'.
                3. Clear Pearl Theme related cache.



                But unfortunately even if I try to change the px the logo always looks big comparing to the page as you can see here: https://poykee.com/



                Any idea how to fix this? Which pixel size to use for the logo?



                Thanks!



                Clemence






                share|improve this answer








                New contributor




                clemence is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.




























                  -2














                  Resize the logo with an image editor, use the width, height attributes of the tag, or use css.






                  share|improve this answer
























                  • i want to resize it use functions of magento

                    – Arif
                    Apr 10 '14 at 13:33











                  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%2f18188%2fhow-to-resize-the-header-logo-of-magento%23new-answer', 'question_page');
                  }
                  );

                  Post as a guest















                  Required, but never shown

























                  6 Answers
                  6






                  active

                  oldest

                  votes








                  6 Answers
                  6






                  active

                  oldest

                  votes









                  active

                  oldest

                  votes






                  active

                  oldest

                  votes









                  2














                  The best way to resize an image in magento isVarien_Image



                  Follow the below code for resize image
                  $image = new Varien_Image('/full/fs/path/to/image.jpg');

                  // you cannot use method chaining with Varien_Image
                  $image->constrainOnly(false);
                  $image->keepFrame(true);
                  // avoid black borders by setting background colour
                  $image->backgroundColor(array(255,255,255));
                  $image->keepAspectRatio(true);
                  $image->resize(216, 139);
                  $image->save('/full/fs/path/to/save/to.jpg');


                  more clearly



                  $_imageUrl = logo die path;
                  $imageResized = Mage::getBaseDir(‘media’).DS.“resized”.$image;
                  if (!file_exists($imageResized)&&file_exists($_imageUrl)) :
                  $imageObj = new Varien_Image($_imageUrl);
                  $imageObj->constrainOnly(TRUE);
                  $imageObj->keepAspectRatio(TRUE);
                  $imageObj->keepFrame(FALSE);
                  $imageObj->resize(140, 140);
                  $imageObj->save($imageResized);
                  endif;





                  share|improve this answer




























                    2














                    The best way to resize an image in magento isVarien_Image



                    Follow the below code for resize image
                    $image = new Varien_Image('/full/fs/path/to/image.jpg');

                    // you cannot use method chaining with Varien_Image
                    $image->constrainOnly(false);
                    $image->keepFrame(true);
                    // avoid black borders by setting background colour
                    $image->backgroundColor(array(255,255,255));
                    $image->keepAspectRatio(true);
                    $image->resize(216, 139);
                    $image->save('/full/fs/path/to/save/to.jpg');


                    more clearly



                    $_imageUrl = logo die path;
                    $imageResized = Mage::getBaseDir(‘media’).DS.“resized”.$image;
                    if (!file_exists($imageResized)&&file_exists($_imageUrl)) :
                    $imageObj = new Varien_Image($_imageUrl);
                    $imageObj->constrainOnly(TRUE);
                    $imageObj->keepAspectRatio(TRUE);
                    $imageObj->keepFrame(FALSE);
                    $imageObj->resize(140, 140);
                    $imageObj->save($imageResized);
                    endif;





                    share|improve this answer


























                      2












                      2








                      2







                      The best way to resize an image in magento isVarien_Image



                      Follow the below code for resize image
                      $image = new Varien_Image('/full/fs/path/to/image.jpg');

                      // you cannot use method chaining with Varien_Image
                      $image->constrainOnly(false);
                      $image->keepFrame(true);
                      // avoid black borders by setting background colour
                      $image->backgroundColor(array(255,255,255));
                      $image->keepAspectRatio(true);
                      $image->resize(216, 139);
                      $image->save('/full/fs/path/to/save/to.jpg');


                      more clearly



                      $_imageUrl = logo die path;
                      $imageResized = Mage::getBaseDir(‘media’).DS.“resized”.$image;
                      if (!file_exists($imageResized)&&file_exists($_imageUrl)) :
                      $imageObj = new Varien_Image($_imageUrl);
                      $imageObj->constrainOnly(TRUE);
                      $imageObj->keepAspectRatio(TRUE);
                      $imageObj->keepFrame(FALSE);
                      $imageObj->resize(140, 140);
                      $imageObj->save($imageResized);
                      endif;





                      share|improve this answer













                      The best way to resize an image in magento isVarien_Image



                      Follow the below code for resize image
                      $image = new Varien_Image('/full/fs/path/to/image.jpg');

                      // you cannot use method chaining with Varien_Image
                      $image->constrainOnly(false);
                      $image->keepFrame(true);
                      // avoid black borders by setting background colour
                      $image->backgroundColor(array(255,255,255));
                      $image->keepAspectRatio(true);
                      $image->resize(216, 139);
                      $image->save('/full/fs/path/to/save/to.jpg');


                      more clearly



                      $_imageUrl = logo die path;
                      $imageResized = Mage::getBaseDir(‘media’).DS.“resized”.$image;
                      if (!file_exists($imageResized)&&file_exists($_imageUrl)) :
                      $imageObj = new Varien_Image($_imageUrl);
                      $imageObj->constrainOnly(TRUE);
                      $imageObj->keepAspectRatio(TRUE);
                      $imageObj->keepFrame(FALSE);
                      $imageObj->resize(140, 140);
                      $imageObj->save($imageResized);
                      endif;






                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      answered Apr 10 '14 at 17:25









                      Amit BeraAmit Bera

                      57.4k1474171




                      57.4k1474171

























                          1














                          Not possible.

                          Either you add width and height attributes on the <img /> tag, or you put as a logo an image with exactly your desired dimensions. (You can do both).






                          share|improve this answer
























                          • is there any magento function to solve it???

                            – Arif
                            Apr 10 '14 at 13:35






                          • 2





                            Read my answer carefully. It starts with 'not possible'. Of course I'm being a little drastic. In theory it is possible but not with what Magento offers. You will have to code everything your self and it's not easy.

                            – Marius
                            Apr 10 '14 at 13:44
















                          1














                          Not possible.

                          Either you add width and height attributes on the <img /> tag, or you put as a logo an image with exactly your desired dimensions. (You can do both).






                          share|improve this answer
























                          • is there any magento function to solve it???

                            – Arif
                            Apr 10 '14 at 13:35






                          • 2





                            Read my answer carefully. It starts with 'not possible'. Of course I'm being a little drastic. In theory it is possible but not with what Magento offers. You will have to code everything your self and it's not easy.

                            – Marius
                            Apr 10 '14 at 13:44














                          1












                          1








                          1







                          Not possible.

                          Either you add width and height attributes on the <img /> tag, or you put as a logo an image with exactly your desired dimensions. (You can do both).






                          share|improve this answer













                          Not possible.

                          Either you add width and height attributes on the <img /> tag, or you put as a logo an image with exactly your desired dimensions. (You can do both).







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Apr 10 '14 at 13:29









                          MariusMarius

                          164k28312662




                          164k28312662













                          • is there any magento function to solve it???

                            – Arif
                            Apr 10 '14 at 13:35






                          • 2





                            Read my answer carefully. It starts with 'not possible'. Of course I'm being a little drastic. In theory it is possible but not with what Magento offers. You will have to code everything your self and it's not easy.

                            – Marius
                            Apr 10 '14 at 13:44



















                          • is there any magento function to solve it???

                            – Arif
                            Apr 10 '14 at 13:35






                          • 2





                            Read my answer carefully. It starts with 'not possible'. Of course I'm being a little drastic. In theory it is possible but not with what Magento offers. You will have to code everything your self and it's not easy.

                            – Marius
                            Apr 10 '14 at 13:44

















                          is there any magento function to solve it???

                          – Arif
                          Apr 10 '14 at 13:35





                          is there any magento function to solve it???

                          – Arif
                          Apr 10 '14 at 13:35




                          2




                          2





                          Read my answer carefully. It starts with 'not possible'. Of course I'm being a little drastic. In theory it is possible but not with what Magento offers. You will have to code everything your self and it's not easy.

                          – Marius
                          Apr 10 '14 at 13:44





                          Read my answer carefully. It starts with 'not possible'. Of course I'm being a little drastic. In theory it is possible but not with what Magento offers. You will have to code everything your self and it's not easy.

                          – Marius
                          Apr 10 '14 at 13:44











                          0














                          The Best Way to do it is With CSS, More Easy and More Clean..



                          If you want a variable image, you can use %..



                          .logo img{ width: 100%;height: 100%}






                          share|improve this answer




























                            0














                            The Best Way to do it is With CSS, More Easy and More Clean..



                            If you want a variable image, you can use %..



                            .logo img{ width: 100%;height: 100%}






                            share|improve this answer


























                              0












                              0








                              0







                              The Best Way to do it is With CSS, More Easy and More Clean..



                              If you want a variable image, you can use %..



                              .logo img{ width: 100%;height: 100%}






                              share|improve this answer













                              The Best Way to do it is With CSS, More Easy and More Clean..



                              If you want a variable image, you can use %..



                              .logo img{ width: 100%;height: 100%}







                              share|improve this answer












                              share|improve this answer



                              share|improve this answer










                              answered Apr 10 '14 at 16:43









                              Rafael DelgadoRafael Delgado

                              1




                              1























                                  0















                                  1. Find logo.phtml and add an id to tag.

                                  2. Then add a custom css specifying width and height you want.






                                  share|improve this answer






























                                    0















                                    1. Find logo.phtml and add an id to tag.

                                    2. Then add a custom css specifying width and height you want.






                                    share|improve this answer




























                                      0












                                      0








                                      0








                                      1. Find logo.phtml and add an id to tag.

                                      2. Then add a custom css specifying width and height you want.






                                      share|improve this answer
















                                      1. Find logo.phtml and add an id to tag.

                                      2. Then add a custom css specifying width and height you want.







                                      share|improve this answer














                                      share|improve this answer



                                      share|improve this answer








                                      edited May 6 '17 at 7:56









                                      Teja Bhagavan Kollepara

                                      2,94841847




                                      2,94841847










                                      answered May 5 '17 at 8:59









                                      SiyandaSiyanda

                                      1




                                      1























                                          0














                                          I have an issue with my logo, I followed normal steps:
                                          1. Magento Admin > Content > Configuration > [store] > Header > Logo Image [Upload]
                                          2. Set Logo Image Width and Height, just fill in numbers, no need to use 'px'.
                                          3. Clear Pearl Theme related cache.



                                          But unfortunately even if I try to change the px the logo always looks big comparing to the page as you can see here: https://poykee.com/



                                          Any idea how to fix this? Which pixel size to use for the logo?



                                          Thanks!



                                          Clemence






                                          share|improve this answer








                                          New contributor




                                          clemence is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                          Check out our Code of Conduct.

























                                            0














                                            I have an issue with my logo, I followed normal steps:
                                            1. Magento Admin > Content > Configuration > [store] > Header > Logo Image [Upload]
                                            2. Set Logo Image Width and Height, just fill in numbers, no need to use 'px'.
                                            3. Clear Pearl Theme related cache.



                                            But unfortunately even if I try to change the px the logo always looks big comparing to the page as you can see here: https://poykee.com/



                                            Any idea how to fix this? Which pixel size to use for the logo?



                                            Thanks!



                                            Clemence






                                            share|improve this answer








                                            New contributor




                                            clemence is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                            Check out our Code of Conduct.























                                              0












                                              0








                                              0







                                              I have an issue with my logo, I followed normal steps:
                                              1. Magento Admin > Content > Configuration > [store] > Header > Logo Image [Upload]
                                              2. Set Logo Image Width and Height, just fill in numbers, no need to use 'px'.
                                              3. Clear Pearl Theme related cache.



                                              But unfortunately even if I try to change the px the logo always looks big comparing to the page as you can see here: https://poykee.com/



                                              Any idea how to fix this? Which pixel size to use for the logo?



                                              Thanks!



                                              Clemence






                                              share|improve this answer








                                              New contributor




                                              clemence is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                              Check out our Code of Conduct.










                                              I have an issue with my logo, I followed normal steps:
                                              1. Magento Admin > Content > Configuration > [store] > Header > Logo Image [Upload]
                                              2. Set Logo Image Width and Height, just fill in numbers, no need to use 'px'.
                                              3. Clear Pearl Theme related cache.



                                              But unfortunately even if I try to change the px the logo always looks big comparing to the page as you can see here: https://poykee.com/



                                              Any idea how to fix this? Which pixel size to use for the logo?



                                              Thanks!



                                              Clemence







                                              share|improve this answer








                                              New contributor




                                              clemence is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                              Check out our Code of Conduct.









                                              share|improve this answer



                                              share|improve this answer






                                              New contributor




                                              clemence is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                              Check out our Code of Conduct.









                                              answered 19 mins ago









                                              clemenceclemence

                                              1




                                              1




                                              New contributor




                                              clemence is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                              Check out our Code of Conduct.





                                              New contributor





                                              clemence is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                              Check out our Code of Conduct.






                                              clemence is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                              Check out our Code of Conduct.























                                                  -2














                                                  Resize the logo with an image editor, use the width, height attributes of the tag, or use css.






                                                  share|improve this answer
























                                                  • i want to resize it use functions of magento

                                                    – Arif
                                                    Apr 10 '14 at 13:33
















                                                  -2














                                                  Resize the logo with an image editor, use the width, height attributes of the tag, or use css.






                                                  share|improve this answer
























                                                  • i want to resize it use functions of magento

                                                    – Arif
                                                    Apr 10 '14 at 13:33














                                                  -2












                                                  -2








                                                  -2







                                                  Resize the logo with an image editor, use the width, height attributes of the tag, or use css.






                                                  share|improve this answer













                                                  Resize the logo with an image editor, use the width, height attributes of the tag, or use css.







                                                  share|improve this answer












                                                  share|improve this answer



                                                  share|improve this answer










                                                  answered Apr 10 '14 at 13:32









                                                  Complex ThingsComplex Things

                                                  872




                                                  872













                                                  • i want to resize it use functions of magento

                                                    – Arif
                                                    Apr 10 '14 at 13:33



















                                                  • i want to resize it use functions of magento

                                                    – Arif
                                                    Apr 10 '14 at 13:33

















                                                  i want to resize it use functions of magento

                                                  – Arif
                                                  Apr 10 '14 at 13:33





                                                  i want to resize it use functions of magento

                                                  – Arif
                                                  Apr 10 '14 at 13:33


















                                                  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.




                                                  draft saved


                                                  draft discarded














                                                  StackExchange.ready(
                                                  function () {
                                                  StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f18188%2fhow-to-resize-the-header-logo-of-magento%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

                                                  Alcázar de San Juan

                                                  Griza ansero

                                                  Heinkel He 51