Bug 13471 - libtiff can not output to stdout
Summary: libtiff can not output to stdout
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: libtiff   
(Show other bugs)
Version: 6.2
Hardware: i386 Linux
medium
medium
Target Milestone: ---
Assignee: Crutcher Dunnavant
QA Contact:
URL:
Whiteboard:
Keywords: FutureFeature
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-07-04 17:28 UTC by mal
Modified: 2008-05-01 15:37 UTC (History)
0 users

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: ---


Attachments (Terms of Use)

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.


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