<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:admin="http://webns.net/mvcb/"
     xmlns:content="http://purl.org/rss/1.0/modules/content/"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
	<channel> 

	<title>Comments on: Batch Adding Text (File Name) to JPEG Images</title>
	<link>http://ask.metafilter.com/107722/Batch-Adding-Text-File-Name-to-JPEG-Images/</link>
	<description>Comments on Ask MetaFilter post Batch Adding Text (File Name) to JPEG Images</description>
	<pubDate>Tue, 25 Nov 2008 14:47:22 -0800</pubDate>
	<lastBuildDate>Tue, 25 Nov 2008 14:47:22 -0800</lastBuildDate>
	<language>en-us</language>
	<docs>http://blogs.law.harvard.edu/tech/rss</docs>
	<ttl>60</ttl>

	<item>
		<title>Question: Batch Adding Text (File Name) to JPEG Images</title>
		<link>http://ask.metafilter.com/107722/Batch-Adding-Text-File-Name-to-JPEG-Images</link>	
		<description>I have a bunch (thousands) of JPEG pictures of my company&apos;s parts. The JPEG file names are the part numbers of the parts (eg. 1234.jpg is a picture of part number 1234. Here&apos;s the tricky part... &lt;br /&gt;&lt;br /&gt; ...none of the JPEG files show the part number in the actual image itself. Is there a batch application out there that will take these JPEG files and add a visible file name to one corner of the image?</description>
		<guid isPermaLink="false">post:ask.metafilter.com,2008:site.107722</guid>
		<pubDate>Tue, 25 Nov 2008 14:33:06 -0800</pubDate>
		<dc:creator>ZenMasterThis</dc:creator>
		
			<category>jpeg</category>
		
			<category>batch</category>
		
			<category>addingtext</category>
		
	</item> <item>
		<title>By: rokusan</title>
		<link>http://ask.metafilter.com/107722/Batch-Adding-Text-File-Name-to-JPEG-Images#1552569</link>	
		<description>I can&apos;t vouch for it, but &lt;a href=&quot;http://bytescout.com/watermarking_add_filename_to_photo.html&quot;&gt;this product&lt;/a&gt; was my third hit for &quot;stamp filename onto image&quot; in Google. It lets you set font, style, color, location... and will use filename as a variable.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.107722-1552569</guid>
		<pubDate>Tue, 25 Nov 2008 14:47:22 -0800</pubDate>
		<dc:creator>rokusan</dc:creator>
	</item><item>
		<title>By: cgg</title>
		<link>http://ask.metafilter.com/107722/Batch-Adding-Text-File-Name-to-JPEG-Images#1552573</link>	
		<description>&lt;a href=&quot;http://www.imagemagick.org/script/index.php&quot;&gt;ImageMagick&lt;/a&gt; to the rescue!&lt;br&gt;
&lt;br&gt;
That is, it does add text to images, via the command line. Someone with a little bit of scripting knowledge could turn it into an automated process with little effort.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.107722-1552573</guid>
		<pubDate>Tue, 25 Nov 2008 14:54:32 -0800</pubDate>
		<dc:creator>cgg</dc:creator>
	</item><item>
		<title>By: roue</title>
		<link>http://ask.metafilter.com/107722/Batch-Adding-Text-File-Name-to-JPEG-Images#1552576</link>	
		<description>Seconding ImageMagick. See &lt;a href=&quot;http://www.imagemagick.org/Usage/text/&quot;&gt;this page&lt;/a&gt; specifically.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.107722-1552576</guid>
		<pubDate>Tue, 25 Nov 2008 14:59:33 -0800</pubDate>
		<dc:creator>roue</dc:creator>
	</item><item>
		<title>By: rokusan</title>
		<link>http://ask.metafilter.com/107722/Batch-Adding-Text-File-Name-to-JPEG-Images#1552588</link>	
		<description>Oh yeah, ImageMagick. I&apos;ve even used that. :)&lt;br&gt;
&lt;br&gt;
You&apos;d have to write your own code to use it for this, though.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.107722-1552588</guid>
		<pubDate>Tue, 25 Nov 2008 15:10:58 -0800</pubDate>
		<dc:creator>rokusan</dc:creator>
	</item><item>
		<title>By: orthogonality</title>
		<link>http://ask.metafilter.com/107722/Batch-Adding-Text-File-Name-to-JPEG-Images#1552606</link>	
		<description>Yeah, Imagemagick.&lt;br&gt;
&lt;br&gt;
To convert a single image:&lt;br&gt;
convert 1234.jpg -fill red -gravity South -pointsize 20 -annotate +0+5 &apos;Part No. 1234&apos; part1234_annotated.jpg&lt;br&gt;
&lt;br&gt;
The arguments to convert make the label 20 points, in red, and place it (&quot;-gravity South&quot;) along the bottom of the image.&lt;br&gt;
&lt;br&gt;
A new image is created, leaving the old image unchanged. &lt;br&gt;
&lt;br&gt;
If you&apos;re running the bash shell (and have the standard linux directory list program) this,entered at the bash prompt, will run the above on all your jpgs:&lt;br&gt;
&lt;br&gt;
for f in [0-9]*.jpg; do fn=${f%.*}; convert ${fn}.jpg -fill black -gravity South -pointsize 20 -annotate +0+5 &quot;Part No.${fn}&quot; ${fn}_annotated.jpg ;done</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.107722-1552606</guid>
		<pubDate>Tue, 25 Nov 2008 15:38:35 -0800</pubDate>
		<dc:creator>orthogonality</dc:creator>
	</item><item>
		<title>By: zhivota</title>
		<link>http://ask.metafilter.com/107722/Batch-Adding-Text-File-Name-to-JPEG-Images#1552616</link>	
		<description>General script for doing a Thing on every file in directory:&lt;br&gt;
&lt;br&gt;
1) Download &lt;a href=&quot;http://www.python.org&quot;&gt;Python&lt;/a&gt;.&lt;br&gt;
&lt;br&gt;
2) Write this into a file called MyScript.py:&lt;br&gt;
&lt;br&gt;
import os.path&lt;br&gt;
dir = &quot;c:\your\folder\here&quot;&lt;br&gt;
&lt;br&gt;
for filename in os.listdir(dir):&lt;br&gt;
     fullpath = os.path.join(dir, filename)&lt;br&gt;
     command = &quot;cp &quot; + fullpath + &quot;c:\.&quot;&lt;br&gt;
     os.system(command)&lt;br&gt;
&lt;br&gt;
3) Run the script in a command line via &quot;python MyScript.py&quot;&lt;br&gt;
&lt;br&gt;
The above script goes through all the files in the &quot;dir&quot; and copies them to the root of the c:\ drive.  Replace the stuff that is assigned to &quot;command&quot; to whatever you find to do what you want in ImageMajick or whatever.&lt;br&gt;
&lt;br&gt;
On Preview:&lt;br&gt;
Based on what orthogonality found in ImageMajick:&lt;br&gt;
&lt;br&gt;
Replace command = &quot;cp &quot; + fullpath + &quot;c:\.&quot; with:&lt;br&gt;
&lt;br&gt;
command = &quot;convert &quot; + fullpath + &quot; -fill red -gravity South -pointsize 20 -annotate +0+5 &apos;Part No. &quot; + filename[0:-4] + &quot;&apos; &quot; + filename[0:-4] + &quot;_annotated.jpg&quot;&lt;br&gt;
&lt;br&gt;
I would highly recommend doing this with a bunch of test images before you try it on any sensitive stuff.  I didn&apos;t test the script, just wrote it out of my head.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.107722-1552616</guid>
		<pubDate>Tue, 25 Nov 2008 15:51:05 -0800</pubDate>
		<dc:creator>zhivota</dc:creator>
	</item><item>
		<title>By: zhivota</title>
		<link>http://ask.metafilter.com/107722/Batch-Adding-Text-File-Name-to-JPEG-Images#1552618</link>	
		<description>Crap, metafilter killed my indenting.  After the for loop, all the statements have to be indented.  This is &lt;strong&gt;required&lt;/strong&gt;.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.107722-1552618</guid>
		<pubDate>Tue, 25 Nov 2008 15:52:16 -0800</pubDate>
		<dc:creator>zhivota</dc:creator>
	</item><item>
		<title>By: ZenMasterThis</title>
		<link>http://ask.metafilter.com/107722/Batch-Adding-Text-File-Name-to-JPEG-Images#1552627</link>	
		<description>Thanks, &lt;b&gt;rokusan&lt;/b&gt;, this is exactly what I need!&lt;br&gt;
&lt;br&gt;
(I had Googled &quot;put ...&quot; and &quot;place ...&quot; but not &quot;stamp ...&quot;)</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.107722-1552627</guid>
		<pubDate>Tue, 25 Nov 2008 16:02:41 -0800</pubDate>
		<dc:creator>ZenMasterThis</dc:creator>
	</item><item>
		<title>By: travis08</title>
		<link>http://ask.metafilter.com/107722/Batch-Adding-Text-File-Name-to-JPEG-Images#1552699</link>	
		<description>If you are using OSX, automator can do this. Just download the adobe photoshop actions, there is one that can add text, including file name, as a watermark. As a bonus you can pick where on the image it does it, and even have it apply a layer style. The layer style would come in handy so that you can apply a stroke to the text, which would make sure it is readable on the image.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.107722-1552699</guid>
		<pubDate>Tue, 25 Nov 2008 17:25:59 -0800</pubDate>
		<dc:creator>travis08</dc:creator>
	</item>
	</channel>
</rss>
