Le weblog entièrement nu

Roland, entièrement nu... de temps en temps.

Archives 2007-02

Nouvelle catégorie : photo

Juste une note en passant pour signaler que je viens de créer une nouvelle catégorie sur ce blog, qui regroupera les billets qui parlent au moins un peu de photo. Maintenant que j'ai un appareil photo numérique (et même deux, puisque j'ai récemment démonté, poussé, tiré, tapé et remonté, en bref réparé, mon Contax U4R qui avait fait une mauvaise chute) et que je commence à faire attention à ce que je mets dans les photos et comment je les prends, je m'autoproclame photographe amateur (niveau novice) et je crée la catégorie. Après tout, un blog, c'est du concentré d'autoproclamation, et on y fait ce qu'on veut.

J'ai déjà étiqueté quelques articles passés, histoire que cette catégorie ne démarre pas entièrement vide.

Tags:
Posted sam. 10 févr. 2007 00:00:00 CET
Téléchargement automatique de photos numériques

Pour ceux qui ne suivent pas assidûment la version anglaise du présent blog, je vais faire une brève annonce en français pour mon script camsync, qui permet d'automatiser :

  • le téléchargement des photos depuis un appareil photo numérique vers le disque dur d'un ordinateur ;
  • l'import des photos dans la base de données de F-Spot, avec une étiquette donnée (par exemple « À trier ») ;
  • et le vidage (partiel) de l'appareil photo, pour assurer qu'il reste au moins un certain espace disponible.

Le tout se déclenche automatiquement dès le branchement de l'appareil sur l'ordinateur, sans qu'il soit nécessaire d'ouvrir une session, ce qui s'avère pratique quand on est en voyage et que le portable a été choisi en fonction de considérations d'encombrement plus que de performances. Ça marche avec les appareils photos numériques qui fonctionnent en PTP (notamment les Canon), mais aussi ceux qui apparaissent comme un disque dur externe (USB mass storage).

Ceux que ça intéresse sont invités à lire la page Synchronisation scripts for digital cameras (en anglais), ou à se contenter d'y récupérer les scripts et fichiers de configuration.

Tags:
Posted ven. 09 févr. 2007 00:00:00 CET
Docbook-Slides to Docbook translator

I have a set of slides for an upcoming training session. They're written in Docbook-Slides, a customised version of Docbook for, well, presentation slides. That customisation is available for Debian in the docbook-slides package, which also contains a few XSL stylesheets to convert the slides into several HTML forms (with frames, without frames, with/without some Javascript helpers, etc.).

Unfortunately, there isn't any proper way to turn these slides into something printable. You can get XSL-FO with other provided stylesheets, but since passivetex is no longer part of Debian, it's hard to get a PDF. Which is silly, since dblatex (as well as others, I'm sure) can turn plain Docbook into nice PDF files.

So I took the time to read a fine XSLT tutorial, and came up with my very first stylesheet, which doesn't print out "Hello world" but rather turns a Docbook-Slides document into a Docbook article. Which dblatex is happy to convert to PDF for me. Let there be much rejoicing. I'm not sure it's a good idea to actually publish one's first snippet of any language, but I'll do it nevertheless, out of hope that I can avoid frustration for some people:

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

<xsl:template match="slides">
<article>
  <xsl:apply-templates select="@*"/>
  <xsl:apply-templates/>
</article>
</xsl:template>

<xsl:template match="slidesinfo">
<articleinfo>
  <xsl:apply-templates select="@*"/>
  <xsl:apply-templates/>
</articleinfo>
</xsl:template>

<xsl:template match="foilgroup|foil">
<section>
  <xsl:apply-templates select="@*"/>
  <xsl:apply-templates/>
</section>
</xsl:template>

<xsl:template match="speakernotes" />

<xsl:template match="*">
  <xsl:element name="{name()}">
    <xsl:apply-templates select="@*"/>
    <xsl:apply-templates/>
  </xsl:element>
</xsl:template>

<xsl:template match="@*">
  <xsl:attribute name="{name()}">
    <xsl:value-of select="."/>
  </xsl:attribute>
</xsl:template>

</xsl:stylesheet>

Attentive readers will notice that, apart from slides and slidesinfo, only the foilgroup and foil elements are converted. In particular, the speakernotes elements are discarded, because I figure they have no place on the printed document. If you need them, beware.

I think I understand what they mean by "XSLT is verbose".

Tags:
Posted ven. 09 févr. 2007 00:00:00 CET
Camsync, now with mass storage support

As already mentioned (Camsync is shaping up), I've been working on a script to automate part of the workflow of digital photography (the part where pictures go from the camera to the computer and get registered into the photo management program).

This script was PTP-only so far, since my other, older, USB mass storage digital camera was broken. I eventually found the time and willpower to tackle it with the usual method:

  • unscrew every screw in sight until you can reach the part you believe is at fault (rather easy when the camera tells you "Zoom error" on boot);
  • poke around, trying to see what sticks;
  • push the thingy;
  • push the thingy harder;
  • hit the thingy;
  • push the thingy (gently) in the appropriate direction;
  • reassemble;
  • find a spring on your desk;
  • disassemble again, put the spring back where it belongs, reassemble;
  • yay, it works!

So I converted my Contax U4R back from an expensive SD-card reader into a working camera (even if the autofocus seems to be less accurate than it used to be).

Anyway. My point is: I've updated my camsync script (and the related Synchronisation scripts for digital cameras page) so it can now handle USB mass storage cameras, as long as they can be accessed through an automounter. I haven't tried it on a memory card reader, but it may just work. As usual, feel free to use, hack, send patches, and report your experiences.

Tags:
Posted mer. 07 févr. 2007 00:00:00 CET
Creative Commons License Sauf indication contraire, le contenu de ce site est mis à disposition sous un contrat Creative Commons.