Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8331039
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T02:18:02+00:00 2026-06-09T02:18:02+00:00

If you go this page , you’ll notice I’m displaying the same version of

  • 0

If you go this page, you’ll notice I’m displaying the same version of image at 2 different places: one for the cloud zoom, and one at the middle of the page without zooming.

I’m currently using 2 different lines of code to generate the image and then return the URL of it, which essentially does the same thing:

<?php /* for cloud zoom */ echo $this->helper('catalog/image')->init($_product, 'image')->constrainOnly(TRUE)->keepAspectRatio(TRUE)->keepFrame(FALSE)->setWatermarkImageOpacity(0)->resize(600, null);?>

<?php /* for middle page */ echo $this->helper('catalog/image')->init($_product, 'image')->constrainOnly(TRUE)->keepAspectRatio(TRUE)->keepFrame(FALSE)->setWatermarkImageOpacity(0)->resize(600, null);?>

This is undoubtedly a lame solution because: 1) it occupies more disk storage as there are 2 distinct image files which are essentially the same image; 2) it significantly slows the page load as the user has to download both images.

So my question is how can I use the same version of image at multiple places in Magento? Is there any way to get the resize() method to return the URL of the image?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T02:18:03+00:00Added an answer on June 9, 2026 at 2:18 am

    Mage_Catalog_Helper_Image has a __toString() method that does exactly that:

    $imageUrl = $this->helper('catalog/image')->init($_product, 'image')->__toString();
    

    HTH

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This page shows correctly in chromium. In firefox (8) it hides the one image
On this page (responsive site in progress) the background image of the containing div
This page summarizes different license types' terms (GPL, LGPL, MIT, BSD, etc): http://www.codeproject.com/info/Licenses.aspx Say
This page should display a Google ad. I Tried everything but it's not working.
This page has been quite confusing for me. It says: Memory management in newLISP
This page in the Android documentation defines an element id as follows: <TextView android:id=@+id/label
This page indicates that TabPage has a GotFocus event, but in Visual Studio 2008
This page says to use: var object = $.extend({}, object1, object2); But I prefer
Check this page. On either firefox, chrome, or IE9 / 10 the tabs on
Using this page, http://developer.android.com/sdk/compatibility-library.html , I have installed the Android Support Package, added a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.