Bug 13471 - libtiff can not output to stdout
libtiff can not output to stdout
Status: CLOSED WONTFIX
Product: Red Hat Linux
Classification: Retired
Component: libtiff (Show other bugs)
6.2
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Crutcher Dunnavant
: FutureFeature
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-07-04 13:28 EDT by mal
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-07-25 16:54:05 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description mal 2000-07-04 13:28:37 EDT
Most of utilities from libtiff 
(such as fax2tiff and etc)
can not output to stdout.
This requires to use files when doing 
multiple format conversion.
The patch below fixes this problem.
It adds a name - (as in GNU utilities)
which indicates stdin for reading or stdout for writing.
After this adding an option
-o - 
to fax2tiff 
causes fax2tiff (and the other utilities)
to print to stdout as expected.
Then the output can be converted to ps without using a file.

--- tiff-v3.5.5/libtiff/tif_unix.c.orig	Tue Jul  4 09:00:13 2000
+++ tiff-v3.5.5/libtiff/tif_unix.c	Tue Jul  4 09:30:14 2000
@@ -149,6 +149,14 @@
 	if (m == -1)
 		return ((TIFF*)0);
 
+	/* check for stdout. */
+        if(strlen(name)==1 && *name=='-') { /* use stdin or stdout stream
*/
+          if(mode[0]=='r') {
+            fd=0; /* stdin */
+          } else {
+            fd=1;  /* stdout */
+          }
+        } else { /* open as a file. */
 /* for cygwin */        
 #ifdef O_BINARY
         m |= O_BINARY;
@@ -159,6 +167,7 @@
 #else
 	fd = open(name, m, 0666);
 #endif
+        }
 	if (fd < 0) {
 		TIFFError(module, "%s: Cannot open", name);
 		return ((TIFF *)0);
Comment 1 mal 2000-07-04 14:02:06 EDT
The patch above does not work as expected.
Some problems still remain.
Comment 2 Crutcher Dunnavant 2000-10-10 16:51:49 EDT
This level change is beyond the scope of packagers (me),
as it would induce pretty serious usage forks between the
Red Hat version, and the pristine sources, please contact
the upstream maintainer with this request if you really need
this functionality.

Note You need to log in before you can comment on or make changes to this bug.