<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Image Resize In Magento &#038; cache the resized image | Subesh Pokhrel&#039;s Blog - Magento Development Tips,PHP,Google Maps</title>
	<atom:link href="http://subesh.com.np/2009/11/image-resize-magento-cache-resized-image/feed/" rel="self" type="application/rss+xml" />
	<link>http://subesh.com.np/2009/11/image-resize-magento-cache-resized-image/</link>
	<description>PHP &#38; Magento Tips &#38; Tutorials</description>
	<lastBuildDate>Wed, 04 Aug 2010 07:24:26 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>Image Resize In Magento &#038; cache the resized image | Subesh Pokhrel&#039;s Blog - Magento Development Tips,PHP,Google Maps</title>
		<link>http://subesh.com.np/2009/11/image-resize-magento-cache-resized-image/comment-page-1/#comment-414</link>
		<dc:creator>Subesh Pokhrel</dc:creator>
		<pubDate>Tue, 18 May 2010 04:22:23 +0000</pubDate>
		<guid isPermaLink="false">http://subesh.com.np/?p=105#comment-414</guid>
		<description>Thanks..! But ..I don&#039;t know..how it did not work for you.... Thanks anyway!</description>
		<content:encoded><![CDATA[<p>Thanks..! But ..I don&#8217;t know..how it did not work for you&#8230;. Thanks anyway!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Image Resize In Magento &#038; cache the resized image | Subesh Pokhrel&#039;s Blog - Magento Development Tips,PHP,Google Maps</title>
		<link>http://subesh.com.np/2009/11/image-resize-magento-cache-resized-image/comment-page-1/#comment-413</link>
		<dc:creator>haltabush</dc:creator>
		<pubDate>Mon, 17 May 2010 16:27:33 +0000</pubDate>
		<guid isPermaLink="false">http://subesh.com.np/?p=105#comment-413</guid>
		<description>Ok, I&#039;ve got it!

I&#039;ve rewrited the splitImageValue, I hope it will work in most cases.
I had to test wether the URL contains /media, for the category image

[code]
	/**
	 * Splits images Path and Name
	 *
	 * Path=custom/module/images/
	 * Name=example.jpg
	 *
	 * @param string $imageValue
	 * @param string $attr
	 * @return string
	 */
	public function splitImageValue($imageValue,$attr=&quot;name&quot;){
		$imArray=explode(&quot;/&quot;,$imageValue);

		$name=$imArray[count($imArray)-1];
		$path=implode(&quot;/&quot;,array_diff($imArray,array($name)));
		if (strpos($path, Mage::getBaseUrl(&#039;media&#039;))===0){
			$path=substr($path, strlen(Mage::getBaseUrl(&#039;media&#039;)));
		}elseif(strpos($path, Mage::getBaseUrl())===0){
			$path=substr($path, strlen(Mage::getBaseUrl()));
		}
		if($attr==&quot;path&quot;){
			return $path;
		}
		else
			return $name;

	}
[/code]</description>
		<content:encoded><![CDATA[<p>Ok, I&#8217;ve got it!</p>
<p>I&#8217;ve rewrited the splitImageValue, I hope it will work in most cases.<br />
I had to test wether the URL contains /media, for the category image</p>
<pre class="brush: plain;">
	/**
	 * Splits images Path and Name
	 *
	 * Path=custom/module/images/
	 * Name=example.jpg
	 *
	 * @param string $imageValue
	 * @param string $attr
	 * @return string
	 */
	public function splitImageValue($imageValue,$attr=&quot;name&quot;){
		$imArray=explode(&quot;/&quot;,$imageValue);

		$name=$imArray[count($imArray)-1];
		$path=implode(&quot;/&quot;,array_diff($imArray,array($name)));
		if (strpos($path, Mage::getBaseUrl('media'))===0){
			$path=substr($path, strlen(Mage::getBaseUrl('media')));
		}elseif(strpos($path, Mage::getBaseUrl())===0){
			$path=substr($path, strlen(Mage::getBaseUrl()));
		}
		if($attr==&quot;path&quot;){
			return $path;
		}
		else
			return $name;

	}
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>Image Resize In Magento &#038; cache the resized image | Subesh Pokhrel&#039;s Blog - Magento Development Tips,PHP,Google Maps</title>
		<link>http://subesh.com.np/2009/11/image-resize-magento-cache-resized-image/comment-page-1/#comment-412</link>
		<dc:creator>haltabush</dc:creator>
		<pubDate>Mon, 17 May 2010 14:13:08 +0000</pubDate>
		<guid isPermaLink="false">http://subesh.com.np/?p=105#comment-412</guid>
		<description>Hi Subesh,
First of all, thank you for this script, I&#039;m sure it will work like a charm soon :)
I&#039;ve juste a little path problem : I give an absolute URL to the function, and looks like it doesn&#039;t like it...
I&#039;m working on it, I&#039;ll post the solution asap.</description>
		<content:encoded><![CDATA[<p>Hi Subesh,<br />
First of all, thank you for this script, I&#8217;m sure it will work like a charm soon <img src='http://subesh.com.np/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
I&#8217;ve juste a little path problem : I give an absolute URL to the function, and looks like it doesn&#8217;t like it&#8230;<br />
I&#8217;m working on it, I&#8217;ll post the solution asap.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Image Resize In Magento &#038; cache the resized image | Subesh Pokhrel&#039;s Blog - Magento Development Tips,PHP,Google Maps</title>
		<link>http://subesh.com.np/2009/11/image-resize-magento-cache-resized-image/comment-page-1/#comment-407</link>
		<dc:creator>Subesh Pokhrel</dc:creator>
		<pubDate>Sat, 08 May 2010 12:00:02 +0000</pubDate>
		<guid isPermaLink="false">http://subesh.com.np/?p=105#comment-407</guid>
		<description>If you have no idea about using Helper then plz start by running a Module creator and then add this code to your helper class found on ModuleFolder/Helper/Data.php. Then call this helper. You can delete all other folder except this and the ETC folder for the module.</description>
		<content:encoded><![CDATA[<p>If you have no idea about using Helper then plz start by running a Module creator and then add this code to your helper class found on ModuleFolder/Helper/Data.php. Then call this helper. You can delete all other folder except this and the ETC folder for the module.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Image Resize In Magento &#038; cache the resized image | Subesh Pokhrel&#039;s Blog - Magento Development Tips,PHP,Google Maps</title>
		<link>http://subesh.com.np/2009/11/image-resize-magento-cache-resized-image/comment-page-1/#comment-406</link>
		<dc:creator>ChristiaanT</dc:creator>
		<pubDate>Sat, 08 May 2010 10:15:25 +0000</pubDate>
		<guid isPermaLink="false">http://subesh.com.np/?p=105#comment-406</guid>
		<description>Hi there!

I would love to implement this helper, but I don&#039;t know where to start. Could you point me in the right direction where to put this code to make it work? I need to resize my category-images.

Thanks in advance!</description>
		<content:encoded><![CDATA[<p>Hi there!</p>
<p>I would love to implement this helper, but I don&#8217;t know where to start. Could you point me in the right direction where to put this code to make it work? I need to resize my category-images.</p>
<p>Thanks in advance!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Image Resize In Magento &#038; cache the resized image | Subesh Pokhrel&#039;s Blog - Magento Development Tips,PHP,Google Maps</title>
		<link>http://subesh.com.np/2009/11/image-resize-magento-cache-resized-image/comment-page-1/#comment-372</link>
		<dc:creator>Guru</dc:creator>
		<pubDate>Tue, 13 Apr 2010 08:10:05 +0000</pubDate>
		<guid isPermaLink="false">http://subesh.com.np/?p=105#comment-372</guid>
		<description>Typo throughout - widht should be width.</description>
		<content:encoded><![CDATA[<p>Typo throughout &#8211; widht should be width.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Image Resize In Magento &#038; cache the resized image | Subesh Pokhrel&#039;s Blog - Magento Development Tips,PHP,Google Maps</title>
		<link>http://subesh.com.np/2009/11/image-resize-magento-cache-resized-image/comment-page-1/#comment-243</link>
		<dc:creator>Phil</dc:creator>
		<pubDate>Wed, 09 Dec 2009 19:19:23 +0000</pubDate>
		<guid isPermaLink="false">http://subesh.com.np/?p=105#comment-243</guid>
		<description>This code works great. Thank you for sharing!</description>
		<content:encoded><![CDATA[<p>This code works great. Thank you for sharing!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
