Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

How to get image width and height from an image url? 
 
AdamQuadmon
Jr. Member
 
Avatar
Total Posts:  20
Joined:  2008-06-06
Perugia - Italy
 

I’m in the category view.

I see that magento use the following code to show images:

<?php $_imageUrl=$this->getCurrentCategory()->getImageUrl() ?>

<img src="<?php echo $_imageUrl ?>” alt="<?php echo $this->htmlEscape($this->getCurrentCategory()->getName()) ?>” />

But in this way there are no width and size attributes.

Can Varien_Image handle this?
Some common library such GD2 can do this but is there a Varien class for managing image attribs?

And where to put this? Inside a core/helper?

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top