* [Printing-architecture] [PATCH] braille: index: Avoid spurious EOF character
2016-04-10 16:29 [Printing-architecture] [PATCH] braille: various fixes Samuel Thibault
@ 2016-04-10 16:31 ` Samuel Thibault
2016-04-10 16:32 ` [Printing-architecture] [PATCH] braille: drop spurious output from tool checking Samuel Thibault
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Samuel Thibault @ 2016-04-10 16:31 UTC (permalink / raw)
To: printing-architecture
[-- Attachment #1: Type: text/plain, Size: 199 bytes --]
A double-EOF is used in some drivers to avoid some USB bug, but this
actually poses more problems than it solves, and notably the cooling fan
never stops, so stop sending double-EOF, only send one.
[-- Attachment #2: patch1 --]
[-- Type: text/plain, Size: 2061 bytes --]
=== modified file 'filter/braille/drivers/index/imageubrltoindexv3.in'
--- filter/braille/drivers/index/imageubrltoindexv3.in 2015-12-12 02:11:10 +0000
+++ filter/braille/drivers/index/imageubrltoindexv3.in 2016-04-10 15:30:51 +0000
@@ -1,7 +1,7 @@
#!/bin/bash
#
-# Copyright (c) 2015 Samuel Thibault <samuel.thibault@ens-lyon.org>
+# Copyright (c) 2015-2016 Samuel Thibault <samuel.thibault@ens-lyon.org>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@@ -311,6 +311,5 @@ fi ) | sed \
printf '\033\006'
# Finish document
printf '\032'
-printf '\032'
echo "INFO: Ready" >&2
=== modified file 'filter/braille/drivers/index/imageubrltoindexv4.in'
--- filter/braille/drivers/index/imageubrltoindexv4.in 2015-12-12 02:11:10 +0000
+++ filter/braille/drivers/index/imageubrltoindexv4.in 2016-04-10 15:30:58 +0000
@@ -1,7 +1,7 @@
#!/bin/bash
#
-# Copyright (c) 2015 Samuel Thibault <samuel.thibault@ens-lyon.org>
+# Copyright (c) 2015-2016 Samuel Thibault <samuel.thibault@ens-lyon.org>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@@ -312,6 +312,5 @@ fi ) | sed \
printf '\033\006'
# Finish document
printf '\032'
-printf '\032'
echo "INFO: Ready" >&2
=== modified file 'filter/braille/drivers/index/textbrftoindexv3.in'
--- filter/braille/drivers/index/textbrftoindexv3.in 2015-12-12 02:11:10 +0000
+++ filter/braille/drivers/index/textbrftoindexv3.in 2016-04-10 15:30:57 +0000
@@ -1,7 +1,7 @@
#!/bin/bash
#
-# Copyright (c) 2015 Samuel Thibault <samuel.thibault@ens-lyon.org>
+# Copyright (c) 2015-2016 Samuel Thibault <samuel.thibault@ens-lyon.org>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@@ -92,6 +92,5 @@ else
fi
printf '\032'
-printf '\032'
echo "INFO: Ready" >&2
^ permalink raw reply [flat|nested] 5+ messages in thread* [Printing-architecture] [PATCH] braille: drop spurious output from tool checking
2016-04-10 16:29 [Printing-architecture] [PATCH] braille: various fixes Samuel Thibault
2016-04-10 16:31 ` [Printing-architecture] [PATCH] braille: index: Avoid spurious EOF character Samuel Thibault
@ 2016-04-10 16:32 ` Samuel Thibault
2016-04-10 16:34 ` [Printing-architecture] [PATCH] braille: Fix banner page printing Samuel Thibault
2016-04-10 17:25 ` [Printing-architecture] [PATCH] braille: various fixes Till Kamppeter
3 siblings, 0 replies; 5+ messages in thread
From: Samuel Thibault @ 2016-04-10 16:32 UTC (permalink / raw)
To: printing-architecture
[-- Attachment #1: Type: text/plain, Size: 71 bytes --]
Checking for tools with "type" is verbose, we need to drop the output.
[-- Attachment #2: patch2 --]
[-- Type: text/plain, Size: 1125 bytes --]
=== modified file 'filter/braille/filters/cups-braille.sh.in'
--- filter/braille/filters/cups-braille.sh.in 2016-01-19 22:48:12 +0000
+++ filter/braille/filters/cups-braille.sh.in 2016-03-31 23:03:27 +0000
@@ -236,7 +236,7 @@ checkTool() {
TOOL=$1
PACKAGE=$2
USE=$3
- if ! type $TOOL
+ if ! type $TOOL > /dev/null
then
printf "ERROR: The $PACKAGE package is required for $USE\n" >&2
exit 1
=== modified file 'filter/braille/filters/texttobrf.in'
--- filter/braille/filters/texttobrf.in 2016-01-21 01:10:01 +0000
+++ filter/braille/filters/texttobrf.in 2016-04-10 16:06:59 +0000
@@ -96,7 +96,7 @@ setupTextRendering() {
# Selected braille table
if [ -n "$LIBLOUIS_TABLES" ]
then
- if type file2brl
+ if type file2brl > /dev/null
then
# Good, we can use liblouisutdml
case $CONTENT_TYPE in
@@ -138,7 +138,7 @@ then
;;
esac
RENDER_CALL="$LIBLOUIS_TOOL -CliteraryTextTable=$LIBLOUIS_TABLES,braille-patterns.cti $LIBLOUIS_CONFIG"
- elif type lou_translate
+ elif type lou_translate > /dev/null
then
# Only liblouis, but better than nothing
setupTextRendering
^ permalink raw reply [flat|nested] 5+ messages in thread* [Printing-architecture] [PATCH] braille: Fix banner page printing
2016-04-10 16:29 [Printing-architecture] [PATCH] braille: various fixes Samuel Thibault
2016-04-10 16:31 ` [Printing-architecture] [PATCH] braille: index: Avoid spurious EOF character Samuel Thibault
2016-04-10 16:32 ` [Printing-architecture] [PATCH] braille: drop spurious output from tool checking Samuel Thibault
@ 2016-04-10 16:34 ` Samuel Thibault
2016-04-10 17:25 ` [Printing-architecture] [PATCH] braille: various fixes Till Kamppeter
3 siblings, 0 replies; 5+ messages in thread
From: Samuel Thibault @ 2016-04-10 16:34 UTC (permalink / raw)
To: printing-architecture
[-- Attachment #1: Type: text/plain, Size: 268 bytes --]
Banners use the application/vnd.cups-pdf-banner MIME type instead of
application/pdf, so recognize that as well. Also, the banner file can
not be opened by the script, we have to really just use the standard
input, and not try to reopen /dev/stdin, which would fail.
[-- Attachment #2: patch3 --]
[-- Type: text/plain, Size: 2370 bytes --]
=== modified file 'filter/braille/filters/texttobrf.in'
--- filter/braille/filters/texttobrf.in 2016-01-21 01:10:01 +0000
+++ filter/braille/filters/texttobrf.in 2016-04-10 16:06:59 +0000
@@ -71,7 +71,7 @@ setupTextRendering() {
checkTool lynx lynx "translating html files"
;;
application/msword)
- CONVERT="antiword /dev/stdin"
+ CONVERT="antiword -"
checkTool antiword antiword "translating MS-Word doc files"
;;
application/vnd.openxmlformats-officedocument.wordprocessingml.document)
@@ -82,8 +82,8 @@ setupTextRendering() {
CONVERT="rtf2txt /dev/stdin"
checkTool rtf2txt rtf2txt "translating RTF files"
;;
- application/pdf)
- CONVERT="pdftotext -raw /dev/stdin /dev/stdout"
+ application/pdf|application/vnd.cups-pdf-banner)
+ CONVERT="pdftotext -raw - -"
checkTool pdftotext poppler "translating PDF files"
;;
*)
@@ -114,7 +114,7 @@ then
;;
application/msword)
LIBLOUIS_TOOL="file2brl"
- CONVERT="antiword -x db /dev/stdin"
+ CONVERT="antiword -x db -"
checkTool antiword antiword "translating MS-Word doc files"
;;
application/vnd.openxmlformats-officedocument.wordprocessingml.document)
@@ -127,9 +127,9 @@ then
CONVERT="rtf2xml /dev/stdin"
checkTool rtf2xml rtf2xml "translating RTF files"
;;
- application/pdf)
+ application/pdf|application/vnd.cups-pdf-banner)
LIBLOUIS_TOOL="file2brl -p"
- CONVERT="pdftotext -raw /dev/stdin /dev/stdout"
+ CONVERT="pdftotext -raw - -"
checkTool pdftotext poppler "translating PDF files"
;;
*)
@@ -156,19 +156,33 @@ fi
# Now proceeed
cd $TMPDIR
echo "INFO: Reformating text" >&2
-[ -z "$FILE" ] && FILE=/dev/stdin
if [ -z "$CONVERT" ]
then
printf "DEBUG: Calling $RENDER_CALL on '%s'\n" "$FILE" >&2
+ if [ -z "$FILE" ]
+ then
+ $RENDER_CALL
+ else
< "$FILE" $RENDER_CALL
+ fi
elif [ -z "$TRANSLATE" ]
then
printf "DEBUG: Calling $CONVERT | $RENDER_CALL on '%s'\n" "$FILE" >&2
+ if [ -z "$FILE" ]
+ then
+ $CONVERT | $RENDER_CALL
+ else
< "$FILE" $CONVERT | $RENDER_CALL
+ fi
else
printf "DEBUG: Calling $CONVERT | $RENDER_CALL | $TRANSLATE on '%s'\n" "$FILE" >&2
+ if [ -z "$FILE" ]
+ then
+ $CONVERT | $RENDER_CALL | $TRANSLATE
+ else
< "$FILE" $CONVERT | $RENDER_CALL | $TRANSLATE
+ fi
fi
echo "INFO: Ready" >&2
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [Printing-architecture] [PATCH] braille: various fixes
2016-04-10 16:29 [Printing-architecture] [PATCH] braille: various fixes Samuel Thibault
` (2 preceding siblings ...)
2016-04-10 16:34 ` [Printing-architecture] [PATCH] braille: Fix banner page printing Samuel Thibault
@ 2016-04-10 17:25 ` Till Kamppeter
3 siblings, 0 replies; 5+ messages in thread
From: Till Kamppeter @ 2016-04-10 17:25 UTC (permalink / raw)
To: printing-architecture
On 04/10/2016 01:29 PM, Samuel Thibault wrote:
> Hello,
>
> The following mails provide various fixes for braille support.
>
> Samuel
Thanks for the patches, everything is applied now.
Till
^ permalink raw reply [flat|nested] 5+ messages in thread