[Printing-architecture] [PATCH] braille: add mirror option

Samuel Thibault samuel.thibault at ens-lyon.org
Sun Sep 17 17:08:08 UTC 2017


Re,

This adds a mirror option for graphical output.

Samuel
-------------- next part --------------
---
 filter/braille/drivers/common/fr-braille.po |    3 +++
 filter/braille/filters/imagemagick.defs     |    4 ++++
 filter/braille/filters/imagetobrf.in        |   12 +++++++++++-
 3 files changed, 18 insertions(+), 1 deletion(-)

--- a/filter/braille/drivers/common/fr-braille.po
+++ b/filter/braille/drivers/common/fr-braille.po
@@ -118,6 +118,9 @@ msgstr "Conversion d'image"
 msgid "Resize"
 msgstr "Retailler"
 
+msgid "Mirror"
+msgstr "Miroir"
+
 msgid "Rotation"
 msgstr "Rotation"
 
--- a/filter/braille/filters/imagemagick.defs
+++ b/filter/braille/filters/imagemagick.defs
@@ -41,6 +41,10 @@ Option "fitplot/Resize" Boolean AnySetup
   *Choice "True/Yes" ""
   Choice "False/No" ""
 
+Option "mirror/Mirror" Boolean AnySetup 10
+  Choice "True/Yes" ""
+  *Choice "False/No" ""
+
 Option "Edge/Edge detection" PickOne AnySetup 10
   Choice "None/None"   ""
   Choice "Edge/Simple" ""
--- a/filter/braille/filters/imagetobrf.in
+++ b/filter/braille/filters/imagetobrf.in
@@ -70,6 +70,16 @@ case "$ROTATE" in
     ;;
 esac
 
+MIRROR=$(getOption mirror)
+case "$MIRROR" in
+  True|true)   MIRROR="-flop" ;;
+  False|false) MIRROR="" ;;
+  *)
+    printf "ERROR: Option mirror must either True or False, got '%s'\n" "$MIRROR" >&2
+    exit 1
+    ;;
+esac
+
 PAGE="-page ${TOTALGRAPHICWIDTH}x${TOTALGRAPHICHEIGHT}+${GRAPHICHOFFSET}+${GRAPHICVOFFSET}"
 
 RESIZE=$(getOption fitplot)
@@ -100,7 +110,7 @@ case $EDGE in
     ;;
 esac
 
-RENDER_CALL="convert $WORK -rotate $ROTATE $PAGE $RESIZE -flatten - $OUTPUT_FORMAT:-"
+RENDER_CALL="convert $WORK -rotate $ROTATE $PAGE $RESIZE $MIRROR -flatten - $OUTPUT_FORMAT:-"
 
 # Now proceeed
 echo "INFO: Converting image" 1>&2


More information about the Printing-architecture mailing list