title: Get original image url Magento (1.6.1.0)
body: <p>I have the following piece of code:</p>
  
  <pre><code>$cProduct = Mage::getModel("catalog/product");
  foreach($products_id as $product_id) {
      $product = $cProduct-&gt;load($product_id);
      //$products_image[] = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA).str_replace(Mage::getBaseUrl('media'),"", $product);
      //$products_image[] = $product-&gt;getMediaConfig()-&gt;getMediaUrl($_product-&gt;getData('image'));
      $products_image[] = $product-&gt;getImageUrl(); //product's image url
  }
  </code></pre>
  
  <p>As you can see, I've tried several ways to get the original image url. Currently I'm using getImageUrl(), but it retrieves the base image, which is a cropped version. How can I retrieve the original image??</p>
  
  <p>Thanks in advance.</p>
  
  <p>Edit:
  Seriously appears there isn't a function for it, been Googling for hours straight (also before posting here). So I've written my own function. </p>
  
  <pre><code>function get_original_image_url($base_image_url) {
      $exploded = explode("/", $base_image_url);
      $image_name = $exploded[count($exploded) - 1];
  
      $original_image_url = "http://yoursitehere.com/media/catalog/product/" . $image_name[0] . "/" .
                             $image_name[1] . "/" . $image_name;
  
      return $original_image_url;
  }
  </code></pre>
  
  <p>I call it with:</p>
  
  <pre><code>$original = get_original_image_url($product-&gt;getImageUrl());
  </code></pre>
  
  <p>Works for me, though it isn't a nice way to do it.</p>