How to resize the header logo of magento?
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
add a comment |
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
add a comment |
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
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
magento-1.7
edited Apr 10 '14 at 13:26
Marius♦
164k28312662
164k28312662
asked Apr 10 '14 at 13:26
ArifArif
1624
1624
add a comment |
add a comment |
6 Answers
6
active
oldest
votes
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;
add a comment |
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).
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
add a comment |
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%}
add a comment |
- Find
logo.phtmland add an id to tag. - Then add a custom css specifying width and height you want.
add a comment |
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
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.
add a comment |
Resize the logo with an image editor, use the width, height attributes of the tag, or use css.
i want to resize it use functions of magento
– Arif
Apr 10 '14 at 13:33
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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;
add a comment |
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;
add a comment |
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;
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;
answered Apr 10 '14 at 17:25
Amit Bera♦Amit Bera
57.4k1474171
57.4k1474171
add a comment |
add a comment |
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).
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
add a comment |
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).
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
add a comment |
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).
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).
answered Apr 10 '14 at 13:29
Marius♦Marius
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
add a comment |
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
add a comment |
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%}
add a comment |
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%}
add a comment |
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%}
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%}
answered Apr 10 '14 at 16:43
Rafael DelgadoRafael Delgado
1
1
add a comment |
add a comment |
- Find
logo.phtmland add an id to tag. - Then add a custom css specifying width and height you want.
add a comment |
- Find
logo.phtmland add an id to tag. - Then add a custom css specifying width and height you want.
add a comment |
- Find
logo.phtmland add an id to tag. - Then add a custom css specifying width and height you want.
- Find
logo.phtmland add an id to tag. - Then add a custom css specifying width and height you want.
edited May 6 '17 at 7:56
Teja Bhagavan Kollepara
2,94841847
2,94841847
answered May 5 '17 at 8:59
SiyandaSiyanda
1
1
add a comment |
add a comment |
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
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.
add a comment |
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
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.
add a comment |
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
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
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.
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.
add a comment |
add a comment |
Resize the logo with an image editor, use the width, height attributes of the tag, or use css.
i want to resize it use functions of magento
– Arif
Apr 10 '14 at 13:33
add a comment |
Resize the logo with an image editor, use the width, height attributes of the tag, or use css.
i want to resize it use functions of magento
– Arif
Apr 10 '14 at 13:33
add a comment |
Resize the logo with an image editor, use the width, height attributes of the tag, or use css.
Resize the logo with an image editor, use the width, height attributes of the tag, or use css.
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
add a comment |
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
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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