1

I am using the catalog helper resize function like this:

Mage::helper('catalog/image')->init($this->getProduct(), 'image', $before_image->getFile())->keepFrame(false)->constrainOnly(true)->resize(800, 600);

This will return the full image size unless it is larger than 800x600.

When it is larger than 800x600, I need to get the resulting size of the resized image. I have pored over the Mage_Catalog_Helper_Image file and cannot find anything that will give me the resulting size.

Is there any method outside of parsing the resulting URL to locate the cached file on my hard drive to determine the final image dimensions?

1
  • if you have getting different size you have install any custom module that will override the functionality or refresh your image cache.
    – Keyul Shah
    Sep 16, 2014 at 5:40

1 Answer 1

2

What you can do is, take what the method is returning, strip the baseurl from it, so you have the path in /media/ and then use getimagesize

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.