2009143
diff -up netpbm-10.35.58/converter/other/fiasco/codec/coder.c.pnmtofiasco-stdin netpbm-10.35.58/converter/other/fiasco/codec/coder.c
2009143
--- netpbm-10.35.58/converter/other/fiasco/codec/coder.c.pnmtofiasco-stdin	2009-01-19 09:23:57.000000000 +0100
2009143
+++ netpbm-10.35.58/converter/other/fiasco/codec/coder.c	2009-01-21 08:03:00.000000000 +0100
2009143
@@ -213,15 +213,14 @@ alloc_coder (char const * const *inputna
2009143
     */
2009143
    {
2009143
       char     *filename;
2009143
-      int   	width, w = 0, height, h = 0;
2009143
+      int   	width, w = 0, height, h = 0, format;
2009143
       bool_t	color, c = NO;
2009143
+      xelval maxval;
2009143
       unsigned 	n;
2009143
       
2009143
       for (n = 0; (filename = get_input_image_name (inputname, n)); n++)
2009143
       {
2009143
           FILE *file;
2009143
-          xelval maxval;
2009143
-          int format;
2009143
           if (filename == NULL)
2009143
               file = stdin;
2009143
           else
2009143
@@ -251,6 +250,8 @@ alloc_coder (char const * const *inputna
2009143
       wi->width  = w;
2009143
       wi->height = h;
2009143
       wi->color  = c;
2009143
+      wi->format = format;
2009143
+      wi->maxval = maxval;
2009143
    }
2009143
 
2009143
    /*
2009143
@@ -642,7 +643,18 @@ video_coder (char const * const *image_t
2009143
        */
2009143
       future_frame   = frame == future_display;
2009143
       c->mt->number   = frame;
2009143
-      c->mt->original = read_image (image_name);
2009143
+      if (strcmp(image_name, "-")) {
2009143
+         c->mt->original = read_image (image_name);
2009143
+      } else { /* stdin is not seekable - read image contents without rewind */
2009143
+	 int width = wfa->wfainfo->width;
2009143
+	 int height = wfa->wfainfo->height;
2009143
+	 int color = wfa->wfainfo->color;
2009143
+	 int format = wfa->wfainfo->format;
2009143
+	 xelval maxval = wfa->wfainfo->maxval;
2009143
+
2009143
+	 c->mt->original = alloc_image(width, height, color, FORMAT_4_4_4);
2009143
+	 read_image_data(c->mt->original, stdin, color, width, height, maxval, format);
2009143
+      }
2009143
       if (c->tiling->exponent && type == I_FRAME) 
2009143
 	 perform_tiling (c->mt->original, c->tiling);
2009143
 
2009143
diff -up netpbm-10.35.58/converter/other/fiasco/codec/wfa.h.pnmtofiasco-stdin netpbm-10.35.58/converter/other/fiasco/codec/wfa.h
2009143
--- netpbm-10.35.58/converter/other/fiasco/codec/wfa.h.pnmtofiasco-stdin	2009-01-19 09:23:57.000000000 +0100
2009143
+++ netpbm-10.35.58/converter/other/fiasco/codec/wfa.h	2009-01-21 08:03:28.000000000 +0100
2009143
@@ -75,6 +75,7 @@ typedef struct range_info
2009143
    unsigned level;			/* bintree level of range */
2009143
 } range_info_t;
2009143
 
2009143
+#include "pnm.h"
2009143
 #include "image.h"
2009143
 #include "rpf.h"
2009143
 #include "bit-io.h"
2009143
@@ -93,6 +94,8 @@ typedef struct wfa_info
2009143
    unsigned  width;			/* image width */
2009143
    unsigned  height;			/* image height */
2009143
    unsigned  level;			/* image level */
2009143
+   unsigned  format;			/* image format */
2009143
+   xelval    maxval;			/* image maximal pixel intensity value */
2009143
    rpf_t    *rpf;			/* Standard reduced precision format */
2009143
    rpf_t    *dc_rpf;			/* DC reduced precision format */
2009143
    rpf_t    *d_rpf;			/* Delta reduced precision format */
2009143
diff -up netpbm-10.35.58/converter/other/fiasco/lib/image.c.pnmtofiasco-stdin netpbm-10.35.58/converter/other/fiasco/lib/image.c
2009143
--- netpbm-10.35.58/converter/other/fiasco/lib/image.c.pnmtofiasco-stdin	2009-01-19 09:23:57.000000000 +0100
2009143
+++ netpbm-10.35.58/converter/other/fiasco/lib/image.c	2009-01-21 08:01:53.000000000 +0100
2009143
@@ -273,7 +273,7 @@ free_image (image_t *image)
2009143
 }
2009143
 
2009143
 
2009143
-static void 
2009143
+void 
2009143
 read_image_data(image_t * const image, FILE *input, const bool_t color,
2009143
                 const int width, const int height, const xelval maxval,
2009143
                 const int format) {
2009143
diff -up netpbm-10.35.58/converter/other/fiasco/lib/image.h.pnmtofiasco-stdin netpbm-10.35.58/converter/other/fiasco/lib/image.h
2009143
--- netpbm-10.35.58/converter/other/fiasco/lib/image.h.pnmtofiasco-stdin	2009-01-19 09:23:57.000000000 +0100
2009143
+++ netpbm-10.35.58/converter/other/fiasco/lib/image.h	2009-01-21 08:02:29.000000000 +0100
2009143
@@ -17,6 +17,8 @@
2009143
 #ifndef _IMAGE_H
2009143
 #define _IMAGE_H
2009143
 
2009143
+#include "pnm.h"
2009143
+
2009143
 #include <stdio.h>
2009143
 #include "types.h"
2009143
 #include "fiasco.h"
2009143
@@ -51,6 +53,10 @@ read_pnmheader (const char *image_name, 
2009143
 image_t *
2009143
 read_image (const char *image_name);
2009143
 void
2009143
+read_image_data(image_t * const image, FILE *input, const bool_t color,
2009143
+                const int width, const int height, const xelval maxval,
2009143
+                const int format);
2009143
+void
2009143
 write_image (const char *image_name, const image_t *image);
2009143
 bool_t
2009143
 same_image_type (const image_t *img1, const image_t *img2);