[wxPython] Re: [Image-SIG] PILing tiff G3 files?

>I'm currently evaluating for a wxPython based fax viewer/manager project
>for fax G3 tiffs, which are typically generated by hylafax.

>I've found the Image Squeezer on http://starship.python.net/jjkunce/
>as a basic example, how to mix wxPython and PIL, where I fall over this:
>When loading a fax tiff, im.mode is set to "1", and trying to convert it
>to RGB results in:

>IOError: decoder group3 not available

>Is there any chance, that PIL supports this decoder soon, or do
>I need to look for other ways to get around this?

Well, I asked the question about 2 years ago and it comes up frequently. I
guess noone with the necessary cash or knowledge has been able to write the
driver.

Bad news!

Well, I dived into this a bit deeper this afternoon, and found a
workaround, because wxImage was able to decode the G3 stuff:

        if img1.format == "TIFF" and img1.mode == "1":
            # Fax G3 tiff
            img = wxImage(self.srcpath, wxBITMAP_TYPE_TIF)
            bm = img.ConvertToBitmap()
            imgsize = bm.GetWidth(), bm.GetHeight()
            img1 = Image.fromstring("RGB", imgsize, img.GetData())

Unfortunately, I ran right across the next problems:

wxImage ignores any subsequent pages of the fax tiff. Does some
enlighted wxMind know, how do I get all images/pages out of this kind
of tiff's?

Now, I stick in the process of getting the scaling of low resolution
faxes right (with different V/H resolutions). I guess, I've to double
every scanline of them :()

Regards,
Stephan

Cheers,
  Hans-Peter

···

On Monday, 11. February 2002 18:12, Stephan Richter wrote:

On Monday, 11. February 2002 15:07, Hans-Peter Jansen wrote:

wxImage ignores any subsequent pages of the fax tiff. Does some
enlighted wxMind know, how do I get all images/pages out of this kind
of tiff's?

If it is the standard TIFF multiple image format then the next release will
be able to get at it. The wxImage constructor now has an optional parameter
to specify which image to pull from the file.

···

--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters?
http://wxPython.org Relax with wxPython!

Hi awesome Robin,

is it available in CVS? Would be much easier for me then fiddling with
tiffsplit and the like...

Is there a way to get the content of the tiff-directories, too (aka tiffinfo)?

Cheers,
  Hans-Peter

···

On Monday, 11. February 2002 23:39, Robin Dunn wrote:

> wxImage ignores any subsequent pages of the fax tiff. Does some
> enlighted wxMind know, how do I get all images/pages out of this kind
> of tiff's?

If it is the standard TIFF multiple image format then the next release will
be able to get at it. The wxImage constructor now has an optional
parameter to specify which image to pull from the file.

is it available in CVS?

Yes.

Is there a way to get the content of the tiff-directories, too (aka

tiffinfo)?

I have no idea what this is. The source in question is in
wxWindows/src/common/imagtiff.cpp and wxWindows/src/tiff*.

···

--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters?
http://wxPython.org Relax with wxPython!