Bug 13471

Summary: libtiff can not output to stdout
Product: [Retired] Red Hat Linux Reporter: mal
Component: libtiffAssignee: Crutcher Dunnavant <crutcher>
Status: CLOSED WONTFIX QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 6.2Keywords: FutureFeature
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-07-25 20:54:05 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description mal 2000-07-04 17:28:37 UTC
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 18:02:06 UTC
The patch above does not work as expected.
Some problems still remain.

Comment 2 Crutcher Dunnavant 2000-10-10 20:51:49 UTC
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.