<?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: Blogging photos and chat logs: some handy scripts</title>
	<atom:link href="http://jfxpt.com/2019/blogging-photos-and-chat-logs-some-handy-scripts/feed/" rel="self" type="application/rss+xml" />
	<link>http://jfxpt.com/2019/blogging-photos-and-chat-logs-some-handy-scripts/</link>
	<description>The search for invariants</description>
	<pubDate>Sat, 07 Mar 2026 21:34:37 +0000</pubDate>
	<generator>http://polimedia.us</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Jacob Welsh</title>
		<link>http://jfxpt.com/2019/blogging-photos-and-chat-logs-some-handy-scripts/#comment-327</link>
		<dc:creator>Jacob Welsh</dc:creator>
		<pubDate>Thu, 01 Oct 2020 19:27:35 +0000</pubDate>
		<guid isPermaLink="false">http://fixpoint.welshcomputing.com/?p=53#comment-327</guid>
		<description>A somewhat tidied and improved version, now renamed to &lt;strong&gt;blog-imgs&lt;/strong&gt; because not all images one might want to feed it will be photos:

&lt;blockquote&gt;&lt;pre style="white-space:pre-wrap;"&gt;
#!/bin/sh
echo -n "Output file prefix: " &gt;/dev/tty
# ^ allows redirecting output to capture the generated html
read pfx
root="/wp-content/uploads/`date +%Y/%m`"
let i=0
for f in "$@" ; do
	let i++
	base="$pfx-$i"
	path="$root/$base"
	# paragraph break for spacing between photos
	printf '\n&#60;a href="%s.jpg"&gt;&#60;img src="%s-640px.jpg" alt="%s" title="%s" class="aligncenter" /&gt;&#60;/a&gt;\n' "$path" "$path" "$base" "$base"
	convert "$f" -auto-orient -geometry 1920x1920 "$base.jpg" 
	convert "$f" -auto-orient -geometry 640x640 "$base-640px.jpg" 
	# ^ duplicating the dimension applies it nicely to whichever is greater
done
&lt;/pre&gt;&lt;/blockquote&gt;

And on the second:

&lt;blockquote&gt;Come to think of it, the first three substitutions there also work for any sort of code import that might contain those pesky &#38;&#60;&gt; characters&lt;/blockquote&gt;

I improved on this concept with some cleverness picked up along the way (mostly from MP, if I recall): the greater-than doesn't technically need quoting, while the double-left-paren and proposed square bracket notation for footnote and code snippet preprocessing can be quoted in the same manner. &lt;strong&gt;raw2wp&lt;/strong&gt;:

&lt;blockquote&gt;&lt;pre style="white-space:pre-wrap;"&gt;
#!/bin/sh
sed 's/&#38;/\&#38;amp;/g; s/&#60;/\&#38;lt;/g; s/(&lpar;/(\&#38;lpar;/g; s/\[\([0-9]*\)\[/[\1\&#38;lsqb;/g'
&lt;pre&gt;&lt;/blockquote&gt;</description>
		<content:encoded><![CDATA[<p>A somewhat tidied and improved version, now renamed to <strong>blog-imgs</strong> because not all images one might want to feed it will be photos:</p>
<blockquote><pre style="white-space:pre-wrap;">
#!/bin/sh
echo -n "Output file prefix: " >/dev/tty
# ^ allows redirecting output to capture the generated html
read pfx
root="/wp-content/uploads/`date +%Y/%m`"
let i=0
for f in "$@" ; do
	let i++
	base="$pfx-$i"
	path="$root/$base"
	# paragraph break for spacing between photos
	printf '\n&lt;a href="%s.jpg">&lt;img src="%s-640px.jpg" alt="%s" title="%s" class="aligncenter" />&lt;/a>\n' "$path" "$path" "$base" "$base"
	convert "$f" -auto-orient -geometry 1920x1920 "$base.jpg"
	convert "$f" -auto-orient -geometry 640x640 "$base-640px.jpg"
	# ^ duplicating the dimension applies it nicely to whichever is greater
done
</pre>
</blockquote>
<p>And on the second:</p>
<blockquote><p>Come to think of it, the first three substitutions there also work for any sort of code import that might contain those pesky &amp;&lt;> characters</p></blockquote>
<p>I improved on this concept with some cleverness picked up along the way (mostly from MP, if I recall): the greater-than doesn't technically need quoting, while the double-left-paren and proposed square bracket notation for footnote and code snippet preprocessing can be quoted in the same manner. <strong>raw2wp</strong>:</p>
<blockquote><pre style="white-space:pre-wrap;">
#!/bin/sh
sed 's/&amp;/\&amp;amp;/g; s/&lt;/\&amp;lt;/g; s/(&lpar;/(\&amp;lpar;/g; s/\[\([0-9]*\)\[/[\1\&amp;lsqb;/g'
</pre>
<pre></pre>
</blockquote>
]]></content:encoded>
	</item>
	<item>
		<title>By: A Little Bit of TinyScheme, a Lot of Cozonac &#171; The Whet</title>
		<link>http://jfxpt.com/2019/blogging-photos-and-chat-logs-some-handy-scripts/#comment-55</link>
		<dc:creator>A Little Bit of TinyScheme, a Lot of Cozonac &#171; The Whet</dc:creator>
		<pubDate>Mon, 25 Nov 2019 14:30:50 +0000</pubDate>
		<guid isPermaLink="false">http://fixpoint.welshcomputing.com/?p=53#comment-55</guid>
		<description>[...] stuff. Except that I wanted to try out Mircea Popescu's image processor for blog articles, and also jfw's version of the same. Except! It turns out the box I'm using for publishing doesn't have Image Magick, [...]</description>
		<content:encoded><![CDATA[<p>[...] stuff. Except that I wanted to try out Mircea Popescu's image processor for blog articles, and also jfw's version of the same. Except! It turns out the box I'm using for publishing doesn't have Image Magick, [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
