<?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>Comments on: WordPress: Provide a Better Naming Convention for Thumbnails</title>
	<atom:link href="http://www.doc4design.com/articles/wordpress-better-naming-of-thumbnails/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.doc4design.com/articles/wordpress-better-naming-of-thumbnails/</link>
	<description>Advertising and Marketing agency located in Northwest Arkansas providing easily attainable, creative solutions for any outlet in any stage of growth.</description>
	<lastBuildDate>Wed, 08 Feb 2012 15:13:19 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Doc4</title>
		<link>http://www.doc4design.com/articles/wordpress-better-naming-of-thumbnails/comment-page-1/#comment-1146</link>
		<dc:creator>Doc4</dc:creator>
		<pubDate>Wed, 27 Apr 2011 23:09:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.doc4design.com/wp/?p=64#comment-1146</guid>
		<description>Mattias, 

Nice work, now we need to bundle this into a plugin.</description>
		<content:encoded><![CDATA[<p>Mattias, </p>
<p>Nice work, now we need to bundle this into a plugin.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mattias Eriksson</title>
		<link>http://www.doc4design.com/articles/wordpress-better-naming-of-thumbnails/comment-page-1/#comment-1140</link>
		<dc:creator>Mattias Eriksson</dc:creator>
		<pubDate>Sun, 24 Apr 2011 17:27:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.doc4design.com/wp/?p=64#comment-1140</guid>
		<description>Actually, I made a much more simpler alteration.

Instead of changing a few files like my last post, you just need to change one file and that is wp-includes/media.php

row 434
old code
&lt;code&gt;
	// $suffix will be appended to the destination filename, just before the extension
	if ( !$suffix )
		$suffix = &quot;{$dst_w}x{$dst_h}&quot;;
&lt;/code&gt;

new code

&lt;code&gt;
	// $suffix will be appended to the destination filename, just before the extension
	if ( !$suffix ){
		//thumbnail
		$max_width = intval(get_option(&#039;thumbnail_size_w&#039;));
		$max_height = intval(get_option(&#039;thumbnail_size_h&#039;));
		
		if($dst_w == $max_width &#124;&#124; $dst_h == $max_height)
			$suffix = &#039;thumbnail&#039;;
		
		//medium
		$max_width = intval(get_option(&#039;medium_size_w&#039;));
		$max_height = intval(get_option(&#039;medium_size_h&#039;));
		
		if($dst_w == $max_width &#124;&#124; $dst_h == $max_height)
			$suffix = &#039;medium&#039;;
		
		//large
		$max_width = intval(get_option(&#039;large_size_w&#039;));
		$max_height = intval(get_option(&#039;large_size_h&#039;));
		
		if($dst_w == $max_width &#124;&#124; $dst_h == $max_height)
			$suffix = &#039;large&#039;;
		
	}
&lt;/code&gt;

This code will check with the values you put on the various sizes and if there is a hit, the suffix will change accordingly. I haven&#039;t tested it so much so if someone sees a mistake somewhere or can apply with a better solution, please do.</description>
		<content:encoded><![CDATA[<p>Actually, I made a much more simpler alteration.</p>
<p>Instead of changing a few files like my last post, you just need to change one file and that is wp-includes/media.php</p>
<p>row 434<br />
old code<br />
<pre><code>
&nbsp;&nbsp;// $suffix will be appended to the destination filename, just before the extension
&nbsp;&nbsp;if ( !$suffix )
&nbsp;&nbsp;&nbsp;&nbsp;$suffix = &quot;{$dst_w}x{$dst_h}&quot;;
</code></pre></p>
<p>new code</p>
<p><pre><code>
&nbsp;&nbsp;// $suffix will be appended to the destination filename, just before the extension
&nbsp;&nbsp;if ( !$suffix ){
&nbsp;&nbsp;&nbsp;&nbsp;//thumbnail
&nbsp;&nbsp;&nbsp;&nbsp;$max_width = intval(get_option(&#039;thumbnail_size_w&#039;));
&nbsp;&nbsp;&nbsp;&nbsp;$max_height = intval(get_option(&#039;thumbnail_size_h&#039;));
&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;if($dst_w == $max_width || $dst_h == $max_height)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$suffix = &#039;thumbnail&#039;;
&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;//medium
&nbsp;&nbsp;&nbsp;&nbsp;$max_width = intval(get_option(&#039;medium_size_w&#039;));
&nbsp;&nbsp;&nbsp;&nbsp;$max_height = intval(get_option(&#039;medium_size_h&#039;));
&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;if($dst_w == $max_width || $dst_h == $max_height)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$suffix = &#039;medium&#039;;
&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;//large
&nbsp;&nbsp;&nbsp;&nbsp;$max_width = intval(get_option(&#039;large_size_w&#039;));
&nbsp;&nbsp;&nbsp;&nbsp;$max_height = intval(get_option(&#039;large_size_h&#039;));
&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;if($dst_w == $max_width || $dst_h == $max_height)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$suffix = &#039;large&#039;;
&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;}
</code></pre></p>
<p>This code will check with the values you put on the various sizes and if there is a hit, the suffix will change accordingly. I haven’t tested it so much so if someone sees a mistake somewhere or can apply with a better solution, please do.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mattias Eriksson</title>
		<link>http://www.doc4design.com/articles/wordpress-better-naming-of-thumbnails/comment-page-1/#comment-1139</link>
		<dc:creator>Mattias Eriksson</dc:creator>
		<pubDate>Sun, 24 Apr 2011 17:01:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.doc4design.com/wp/?p=64#comment-1139</guid>
		<description>Hi.

I think I&#039;ve managed to solve the isseu where you want the naming to be image-thumbnail.jpg, image-medium.jpg and image-large.jpg. If someone else have another good idea, please do tell.

The following was done with some core files (wordpress 3.1.1) :

in file wp-admin/includes/image.php

row 107
old code:
&lt;code&gt;
$sizes[$s] = array( &#039;width&#039; =&gt; &#039;&#039;, &#039;height&#039; =&gt; &#039;&#039;, &#039;crop&#039; =&gt; FALSE );
&lt;/code&gt;
new code
&lt;code&gt;
$sizes[$s] = array( &#039;width&#039; =&gt; &#039;&#039;, &#039;height&#039; =&gt; &#039;&#039;, &#039;crop&#039; =&gt; FALSE, &#039;image_size&#039; =&gt; $s );
&lt;/code&gt;

row 125
old code
&lt;code&gt;
$resized = image_make_intermediate_size( $file, $size_data[&#039;width&#039;], $size_data[&#039;height&#039;], $size_data[&#039;crop&#039;] );
&lt;/code&gt;
new code
&lt;code&gt;
$resized = image_make_intermediate_size( $file, $size_data[&#039;width&#039;], $size_data[&#039;height&#039;], $size_data[&#039;crop&#039;], $size_data[&#039;image_size&#039;] );
&lt;/code&gt;

in file wp-includes/media.php

row 406
old code
&lt;code&gt;
function image_resize( $file, $max_w, $max_h, $crop = false, $suffix = null, $dest_path = null, $jpeg_quality = 90 ) {
&lt;/code&gt;
new code
&lt;code&gt;
function image_resize( $file, $max_w, $max_h, $crop = false, $suffix = null, $dest_path = null, $jpeg_quality = 90, $image_size = null ) {
&lt;/code&gt;

row 434-435
old code
&lt;code&gt;
	if ( !$suffix )
		$suffix = &quot;{$dst_w}x{$dst_h}&quot;;
&lt;/code&gt;
new code
&lt;code&gt;
	if ( !$suffix ){
		if($image_size != null)
			$suffix = $image_size;
		else
			$suffix = &quot;{$dst_w}x{$dst_h}&quot;;
	}
&lt;/code&gt;

row 484 (or maybe higher because of alteration of code above)
old code
&lt;code&gt;
function image_make_intermediate_size($file, $width, $height, $crop=false) {
&lt;/code&gt;
new code
&lt;code&gt;
function image_make_intermediate_size($file, $width, $height, $crop=false, $image_size = null) {
&lt;/code&gt;

row 486
old code
&lt;code&gt;
$resized_file = image_resize($file, $width, $height, $crop);
&lt;/code&gt;
new code
&lt;code&gt;
$resized_file = image_resize($file, $width, $height, $crop, $image_size);
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Hi.</p>
<p>I think I’ve managed to solve the isseu where you want the naming to be image-thumbnail.jpg, image-medium.jpg and image-large.jpg. If someone else have another good idea, please do tell.</p>
<p>The following was done with some core files (wordpress 3.1.1) :</p>
<p>in file wp-admin/includes/image.php</p>
<p>row 107<br />
old code:<br />
<pre><code>
$sizes[$s] = array( &#039;width&#039; =&gt; &#039;&#039;, &#039;height&#039; =&gt; &#039;&#039;, &#039;crop&#039; =&gt; FALSE );
</code></pre><br />
new code<br />
<pre><code>
$sizes[$s] = array( &#039;width&#039; =&gt; &#039;&#039;, &#039;height&#039; =&gt; &#039;&#039;, &#039;crop&#039; =&gt; FALSE, &#039;image_size&#039; =&gt; $s );
</code></pre></p>
<p>row 125<br />
old code<br />
<pre><code>
$resized = image_make_intermediate_size( $file, $size_data[&#039;width&#039;], $size_data[&#039;height&#039;], $size_data[&#039;crop&#039;] );
</code></pre><br />
new code<br />
<pre><code>
$resized = image_make_intermediate_size( $file, $size_data[&#039;width&#039;], $size_data[&#039;height&#039;], $size_data[&#039;crop&#039;], $size_data[&#039;image_size&#039;] );
</code></pre></p>
<p>in file wp-includes/media.php</p>
<p>row 406<br />
old code<br />
<pre><code>
function image_resize( $file, $max_w, $max_h, $crop = false, $suffix = null, $dest_path = null, $jpeg_quality = 90 ) {
</code></pre><br />
new code<br />
<pre><code>
function image_resize( $file, $max_w, $max_h, $crop = false, $suffix = null, $dest_path = null, $jpeg_quality = 90, $image_size = null ) {
</code></pre></p>
<p>row 434-435<br />
old code<br />
<pre><code>
&nbsp;&nbsp;if ( !$suffix )
&nbsp;&nbsp;&nbsp;&nbsp;$suffix = &quot;{$dst_w}x{$dst_h}&quot;;
</code></pre><br />
new code<br />
<pre><code>
&nbsp;&nbsp;if ( !$suffix ){
&nbsp;&nbsp;&nbsp;&nbsp;if($image_size != null)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$suffix = $image_size;
&nbsp;&nbsp;&nbsp;&nbsp;else
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$suffix = &quot;{$dst_w}x{$dst_h}&quot;;
&nbsp;&nbsp;}
</code></pre></p>
<p>row 484 (or maybe higher because of alteration of code above)<br />
old code<br />
<pre><code>
function image_make_intermediate_size($file, $width, $height, $crop=false) {
</code></pre><br />
new code<br />
<pre><code>
function image_make_intermediate_size($file, $width, $height, $crop=false, $image_size = null) {
</code></pre></p>
<p>row 486<br />
old code<br />
<pre><code>
$resized_file = image_resize($file, $width, $height, $crop);
</code></pre><br />
new code<br />
<pre><code>
$resized_file = image_resize($file, $width, $height, $crop, $image_size);
</code></pre></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jay</title>
		<link>http://www.doc4design.com/articles/wordpress-better-naming-of-thumbnails/comment-page-1/#comment-1062</link>
		<dc:creator>Jay</dc:creator>
		<pubDate>Thu, 20 Jan 2011 23:50:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.doc4design.com/wp/?p=64#comment-1062</guid>
		<description>Yes, that is whats happening. Both small and medium are being renamed to thb-imagename &gt; hence, the small size gets replaced with the same naming &#039;medium&#039; file :( so i am now getting one less image size than i should</description>
		<content:encoded><![CDATA[<p>Yes, that is whats happening. Both small and medium are being renamed to thb-imagename &gt; hence, the small size gets replaced with the same naming ‘medium’ file <img src='http://www.doc4design.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  so i am now getting one less image size than i should</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Doc4</title>
		<link>http://www.doc4design.com/articles/wordpress-better-naming-of-thumbnails/comment-page-1/#comment-992</link>
		<dc:creator>Doc4</dc:creator>
		<pubDate>Thu, 16 Dec 2010 00:55:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.doc4design.com/wp/?p=64#comment-992</guid>
		<description>Anja, 

Good point. This scenario doesn&#039;t take into consideration alternate image sizes. We will look into this.</description>
		<content:encoded><![CDATA[<p>Anja, </p>
<p>Good point. This scenario doesn’t take into consideration alternate image sizes. We will look into this.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anja</title>
		<link>http://www.doc4design.com/articles/wordpress-better-naming-of-thumbnails/comment-page-1/#comment-989</link>
		<dc:creator>Anja</dc:creator>
		<pubDate>Wed, 15 Dec 2010 13:00:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.doc4design.com/wp/?p=64#comment-989</guid>
		<description>This is great ! ALMOST exactly what I needed. Problem is... what happens with medium sized images? Will they be called -thumbnail, too? I am looking for a way to do the same for medium sized images so that I will have myimage-medium.jpg and myimage-thumbnail.jpg in the end! 
Seems this will get me one step further ... thank you for that. Great work!</description>
		<content:encoded><![CDATA[<p>This is great ! ALMOST exactly what I needed. Problem is… what happens with medium sized images? Will they be called -thumbnail, too? I am looking for a way to do the same for medium sized images so that I will have myimage-medium.jpg and myimage-thumbnail.jpg in the end!<br />
Seems this will get me one step further … thank you for that. Great work!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: wp-popular.com &#187; Blog Archive &#187; WordPress: Provide a Better Naming Convention for Thumbnails &#124; Doc4</title>
		<link>http://www.doc4design.com/articles/wordpress-better-naming-of-thumbnails/comment-page-1/#comment-715</link>
		<dc:creator>wp-popular.com &#187; Blog Archive &#187; WordPress: Provide a Better Naming Convention for Thumbnails &#124; Doc4</dc:creator>
		<pubDate>Thu, 12 Aug 2010 10:10:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.doc4design.com/wp/?p=64#comment-715</guid>
		<description>[...] See original here: WordPress: Provide a Better Naming Convention for Thumbnails &#124; Doc4 [...]</description>
		<content:encoded><![CDATA[<p>[...] See original here: WordPress: Provide a Better Naming Convention for Thumbnails | Doc4 [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Descubrimientos del 25 Marzo 2010 &#124; Blog de unique3w</title>
		<link>http://www.doc4design.com/articles/wordpress-better-naming-of-thumbnails/comment-page-1/#comment-444</link>
		<dc:creator>Descubrimientos del 25 Marzo 2010 &#124; Blog de unique3w</dc:creator>
		<pubDate>Thu, 25 Mar 2010 07:21:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.doc4design.com/wp/?p=64#comment-444</guid>
		<description>[...] Prove&#233; a wordpress de un mejor nombrado de thumbnails.// WordPress: Provide a Better Naming C... [...]</description>
		<content:encoded><![CDATA[<p>[...] Proveé a wordpress de un mejor nombrado de thumbnails.// WordPress: Provide a Better Naming C… [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Twitted by ameliajp</title>
		<link>http://www.doc4design.com/articles/wordpress-better-naming-of-thumbnails/comment-page-1/#comment-405</link>
		<dc:creator>Twitted by ameliajp</dc:creator>
		<pubDate>Thu, 04 Mar 2010 16:36:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.doc4design.com/wp/?p=64#comment-405</guid>
		<description>[...] This post was Twitted by ameliajp [...]</description>
		<content:encoded><![CDATA[<p>[...] This post was Twitted by ameliajp [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Better Thumbnail Naming Convention: Control Your Thumbnails - WordPress Forums</title>
		<link>http://www.doc4design.com/articles/wordpress-better-naming-of-thumbnails/comment-page-1/#comment-13</link>
		<dc:creator>Better Thumbnail Naming Convention: Control Your Thumbnails - WordPress Forums</dc:creator>
		<pubDate>Mon, 27 Jul 2009 01:35:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.doc4design.com/wp/?p=64#comment-13</guid>
		<description>[...] Better Thumbnail Naming Convention: Control Your Thumbnails      Ever wanted to use the custom field for thumbnails or list an image in a custom field and use it for a thumbnail image as well? Take a look at this article on how to control your thumbnails.  WordPress: Provide a Better Naming Convention for Thumbnails [...]</description>
		<content:encoded><![CDATA[<p>[...] Better Thumbnail Naming Convention: Control Your Thumbnails      Ever wanted to use the custom field for thumbnails or list an image in a custom field and use it for a thumbnail image as well? Take a look at this article on how to control your thumbnails.  WordPress: Provide a Better Naming Convention for Thumbnails [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>

