<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet href="/assets/rss.xsl" type="text/xsl"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"

>
<channel>
	<title>Sacha Chua - tag - language</title>
	<atom:link href="https://sachachua.com/blog/tag/language/feed/index.xml" rel="self" type="application/rss+xml" />
	<atom:link href="https://sachachua.com/blog/tag/language" rel="alternate" type="text/html" />
	<link>https://sachachua.com/blog/tag/language/feed/index.xml</link>
	<description>Emacs, sketches, and life</description>
  
	<lastBuildDate>Tue, 14 Jul 2026 18:22:03 GMT</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>daily</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>11ty</generator>
  <item>
		<title>Experimenting with adding labels to photos</title>
		<link>https://sachachua.com/blog/2018/06/experimenting-with-adding-labels-to-photos/</link>
		<dc:creator><![CDATA[Sacha Chua]]></dc:creator>
		<pubDate>Sat, 16 Jun 2018 03:45:00 GMT</pubDate>
    <category>geek</category>
<category>linux</category>
		<guid isPermaLink="false">https://sachachua.com/blog/?p=29240</guid>
		<description><![CDATA[<p>A-&#8216;s gotten really interested in letters lately, so I'm looking for ways to add more personally relevant text and images to her life. She often flips through the 4&#8243;x6&#8243; photos I got printed. Since they're photos, they're sturdier and can stand up to a little bending. I wanted to experiment with printing more pictures and labeling them with text, building on the script I used to <a href="https://sachachua.com/blog/2018/03/labeling-toy-storage-bins-with-photos-and-text-using-imagemagick-and-org-babel/">label our toy storage bins</a>. Here's a sample:</p>
<p><a href="https://sachachua.com/blog/wp-content/uploads/2018/06/2018-06-14-16-12-14-★★★-A-gently-lifted-the-flaps-in-the-book.-🏷fine-motor-3.jpg"><img loading="lazy" class="alignnone size-medium wp-image-29242" src="https://sachachua.com/blog/wp-content/uploads/2018/06/2018-06-14-16-12-14-★★★-A-gently-lifted-the-flaps-in-the-book.-🏷fine-motor-3-640x427.jpg" alt="2018-06-14-16-12-14 ★★★ A- gently lifted the flaps in the book. 🏷fine-motor" width="640" height="427" srcset="https://sachachua.com/blog/wp-content/uploads/2018/06/2018-06-14-16-12-14-★★★-A-gently-lifted-the-flaps-in-the-book.-🏷fine-motor-3-640x427.jpg 640w, https://sachachua.com/blog/wp-content/uploads/2018/06/2018-06-14-16-12-14-★★★-A-gently-lifted-the-flaps-in-the-book.-🏷fine-motor-3-280x187.jpg 280w, https://sachachua.com/blog/wp-content/uploads/2018/06/2018-06-14-16-12-14-★★★-A-gently-lifted-the-flaps-in-the-book.-🏷fine-motor-3-768x512.jpg 768w" sizes="(max-width: 640px) 100vw, 640px"></a></p>
<p>(Name still elided in the sample until I figure out what we want to do with names and stuff. I'll use <code>NAME_REPLACEMENTS</code> to put her name into the printed ones, though, since kids tend to learn how to read their names first.)</p>
<p>I haven't printed these out yet to see how legible they are, but a quick on-screen check looks promising.</p>
<p><code>prepare-for-printing:</code></p>
<div class="org-src-container">
<pre class="src src-sh"><span class="org-comment-delimiter">#</span><span class="org-comment">!/bin/</span><span class="org-keyword">bash</span>

<span class="org-comment-delimiter"># </span><span class="org-comment">Add label from ImageDescription EXIF tag to bottom of photo</span>

<span class="org-variable-name">destination</span>=~/cloud/print
<span class="org-variable-name">description_field</span>=ImageDescription
<span class="org-variable-name">font</span>=Alegreya-Regular
<span class="org-variable-name">SAVEIFS</span>=$<span class="org-variable-name">IFS</span>
<span class="org-variable-name">IFS</span>=$(<span class="org-builtin">echo</span> -en <span class="org-string">"\n\b"</span>)
<span class="org-variable-name">border</span>=50
<span class="org-variable-name">output_width_inches</span>=6
<span class="org-variable-name">output_height_inches</span>=4

<span class="org-comment-delimiter"># </span><span class="org-comment">NAME_REPLACEMENTS is an environment variable that's a sed expression</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">for any name replacements, like s/A-/Actual name goes here/g</span>

<span class="org-keyword">for</span> file<span class="org-keyword"> in</span> $<span class="org-variable-name">*</span>; <span class="org-keyword">do</span>
  <span class="org-variable-name">description</span>=$(exiftool -s -s -s -$<span class="org-variable-name">description_field</span> <span class="org-string">"$file"</span> <span class="org-sh-escaped-newline">\</span>
     | sed <span class="org-string">"s/\"/\\\"/g;s/'/\\\'/g;$NAME_REPLACEMENTS"</span>)
  <span class="org-variable-name">date</span>=$(exiftool -s -s -s -DateTimeOriginal <span class="org-string">"$file"</span> <span class="org-sh-escaped-newline">\</span>
     | cut -c 1-10 | sed s/:/-/g)
  <span class="org-variable-name">width</span>=$(identify -format <span class="org-string">"%w"</span> <span class="org-string">"$file"</span>)
  <span class="org-variable-name">height</span>=$(identify -format <span class="org-string">"%h"</span> <span class="org-string">"$file"</span>)
  <span class="org-variable-name">largest</span>=$(( $<span class="org-variable-name">width</span> &gt; $<span class="org-variable-name">height</span> ? $<span class="org-variable-name">width</span> : $<span class="org-variable-name">height</span> ))
  <span class="org-variable-name">pointsize</span>=12
  <span class="org-variable-name">density</span>=$(( $<span class="org-variable-name">largest</span> / $<span class="org-variable-name">output_width_inches</span> ))
  <span class="org-variable-name">correct_height</span>=$(( $<span class="org-variable-name">output_height_inches</span> * $<span class="org-variable-name">density</span> ))
  <span class="org-variable-name">captionwidth</span>=$(( $<span class="org-variable-name">width</span> - $<span class="org-variable-name">border</span> * 2 ))
  convert <span class="org-string">"$file"</span> -density $<span class="org-variable-name">density</span> -units PixelsPerInch <span class="org-sh-escaped-newline">\</span>
    -gravity North -extent ${<span class="org-variable-name">width</span>}x${<span class="org-variable-name">correct_height</span>} <span class="org-sh-escaped-newline">\</span>
    -strip <span class="org-string">\(</span> -undercolor white -background white <span class="org-sh-escaped-newline">\</span>
    -fill black -font <span class="org-string">"$font"</span> -bordercolor White <span class="org-sh-escaped-newline">\</span>
    -gravity SouthWest -border $<span class="org-variable-name">border</span> -pointsize $<span class="org-variable-name">pointsize</span> <span class="org-sh-escaped-newline">\</span>
    -size ${<span class="org-variable-name">captionwidth</span>}x  caption:<span class="org-string">"$date $description"</span> <span class="org-string">\)</span> <span class="org-sh-escaped-newline">\</span>
    -composite <span class="org-string">"$destination/$file"</span>
<span class="org-keyword">done</span>
<span class="org-variable-name">IFS</span>=$<span class="org-variable-name">SAVEIFS</span>
gwenview $<span class="org-variable-name">destination</span>
</pre>
</div>
<p>Here's my current <code>rename-based-on-exif</code>, too. I modified it to use the <code>ImageDescription</code> or the <code>UserComment</code> field, and I switched to using Unicode stars and labels instead of # to minimize problems with exporting to HTML.</p>
<div class="org-src-container">
<pre class="src src-sh"><span class="org-comment-delimiter">#</span><span class="org-comment">!/bin/</span><span class="org-keyword">bash</span>

<span class="org-variable-name">date</span>=<span class="org-string">"\${DateTimeOriginal;s/[ :]/-/g}"</span>
<span class="org-variable-name">rating</span>=<span class="org-string">"\${Rating;s/([1-5])/'★' x \$1/e}"</span>
<span class="org-variable-name">tags</span>=<span class="org-string">"\${Subject;s/^/🏷/;s/, / 🏷/g}"</span>
<span class="org-variable-name">field</span>=FileName  <span class="org-comment-delimiter"># </span><span class="org-comment">TestName for testing</span>
exiftool -m -<span class="org-string">"$field&lt;$date $rating \${ImageDescription} $tags.%e"</span> \
         -<span class="org-string">"$field&lt;$date $rating \${UserComment} $tags.%e"</span> <span class="org-string">"$@"</span></pre>
</div>
<p>In order to upload my fancy-shmancy Unicode-filenamed files, I also had to convert my WordPress database from utf8 to utf8mb4. <a href="https://florianbrinkmann.com/en/3457/switch-wordpress-from-utf8-to-utf8mb4-retrospectively/">This upgrade plugin</a> was very helpful.</p>

<p>You can <a href="mailto:sacha@sachachua.com?subject=Comment%20on%20https%3A%2F%2Fsachachua.com%2Fblog%2F2018%2F06%2Fexperimenting-with-adding-labels-to-photos%2F&body=Name%20you%20want%20to%20be%20credited%20by%20(if%20any)%3A%20%0AMessage%3A%20%0ACan%20I%20share%20your%20comment%20so%20other%20people%20can%20learn%20from%20it%3F%20Yes%2FNo%0A">e-mail me at sacha@sachachua.com</a>.</p>]]></description>
		</item><item>
		<title>Learning sewing and French</title>
		<link>https://sachachua.com/blog/2008/09/learning-sewing-and-french/</link>
		<dc:creator><![CDATA[Sacha Chua]]></dc:creator>
		<pubDate>Sun, 28 Sep 2008 21:24:40 GMT</pubDate>
    <category>sewing</category>
		<guid isPermaLink="false">https://sachachua.com/blog/?p=5188</guid>
		<description><![CDATA[<p>Sewing is turning out to be surprisingly fun. I finished the wool jumper-dress (<a href="http://www.simplicity.com/dv1_v4.cfm?design=4097">Simplicity 4097</a>), learning how to work with wool and lining. It&#8217;s amazing how even my not-quite-matched-up work looks better with a little bit of lining. In a burst of confidence, I wore my jumper outside the house yesterday. It didn&#8217;t fall apart on me (hooray!), and it made me smile. And I didn&#8217;t need to unpick nearly as many seams this time around. I think I only ripped out one mistake. </p>
<p>I&#8217;ve started working on a matching blazer. It&#8217;ll be my first time working with interfacing (to stiffen the jacket front), reverse facing, and sleeves. I&#8217;m a little nervous about the sleeves, but I&#8217;m sure I&#8217;ll figure them out. I&#8217;m half-way through the process and the blazer is looking pretty neat.</p>
<p>W- and I passed by a fabric place earlier. He picked up some black-and-beige cloth for reupholstering the dining room chairs, and I picked up 2 3/4 yards of 60&#8243; red wool. I think I&#8217;ll make another jumper with a different neckline. =) </p>
<p>I&#8217;m starting to really enjoy carefully measuring and cutting the fabric because I know that the attention I put into the early stages will pay off later on. The boxes we bought from Ikea yesterday have also greatly helped me organize my sewing corner. I was planning to get a sewing machine cover just to make sure Leia doesn&#8217;t get tempted by the thread, but the universal sewing machine cover looks clunky. I may just have to sew a sewing machine cozy. ;)</p>
<p>When I told Stephen Perelgut about my new hobby, he laughed and joked about my having too much free time. That&#8217;s not really true. I could always find plenty of things to do. I can be using this time to draw, write, cook, exercise, code, tidy up, fiddle with things, play with the cat, read&#8230; </p>
<p>I&#8217;m glad I added sewing to the mix, though. I enjoy creating things. Sewing is teaching me more about thinking in three dimensions with different colors and textures. Constructing my own clothes teaches me about the techniques used in the clothes I wear and the clothes other people wear, developing my eye. I&#8217;m getting better at accurately following instructions, deviating from the pattern where necessary. I think it does me good. In fact, it&#8217;s so enjoyable that I&#8217;ve started setting limits on how much time I spend sewing at any one sitting. (Leia also helps me keep track of time. Yay for cuddly cats!)</p>
<p>I&#8217;ve also been doing French lessons in the background. Of course, since I&#8217;m learning from Pimsleur language CDs (hooray library!), the example dialogue&#8217;s like this: &#8220;Bonjour, madamoiselle. Est-ce que vous voudrais bois quelque chose chez moi?&#8221; Aiyah. It was like that for Pimsleur Cantonese, too.</p>
<p>Still, learning is lots of fun. =)</p>

<p>You can <a href="https://sachachua.com/blog/2008/09/learning-sewing-and-french/#comment">view 4 comments</a> or <a href="mailto:sacha@sachachua.com?subject=Comment%20on%20https%3A%2F%2Fsachachua.com%2Fblog%2F2008%2F09%2Flearning-sewing-and-french%2F&body=Name%20you%20want%20to%20be%20credited%20by%20(if%20any)%3A%20%0AMessage%3A%20%0ACan%20I%20share%20your%20comment%20so%20other%20people%20can%20learn%20from%20it%3F%20Yes%2FNo%0A">e-mail me at sacha@sachachua.com</a>.</p>]]></description>
		</item>
	</channel>
</rss>