Bug 212773 - Multipage TIFF image is not supported
Summary: Multipage TIFF image is not supported
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.3.1   Edit
Hardware: PC Windows XP
: P3 normal with 2 votes (vote)
Target Milestone: ---   Edit
Assignee: Lakshmi P Shanmugam CLA
QA Contact: Carolyn MacLeod CLA
URL:
Whiteboard: stalebug
Keywords:
Depends on: 57382
Blocks:
  Show dependency tree
 
Reported: 2007-12-12 11:18 EST by David Kyle CLA
Modified: 2019-11-14 03:08 EST (History)
3 users (show)

See Also:


Attachments
multi page tiff (1.29 MB, image/tiff)
2008-09-09 20:04 EDT, Craig Foote CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Kyle CLA 2007-12-12 11:18:36 EST
Build ID: M20071023-1652

Multipage TIFF images are a standard in the oil industry. 100 or more images in a single TIFF file is not uncommon.
Comment 1 Craig Foote CLA 2008-09-09 20:04:42 EDT
Created attachment 112149 [details]
multi page tiff
Comment 2 Steve Northover CLA 2008-09-10 19:35:35 EDT
Carolyn, looks like some more potential image work for 3.5.
Comment 3 Carolyn MacLeod CLA 2009-08-11 11:12:00 EDT
Fixed > 20090811.

I have released the code to handle multi-page TIFFs - it is fairly simple code. Unfortunately, the only multi-page TIFFs I can find are not currently supported by SWT's baseline TIFF reader. So for this feature to be useful, we need to also support the TIFF type requested in bug 57382.
Comment 4 Carolyn MacLeod CLA 2009-08-11 11:17:46 EDT
Note that I only added decoder (loader) support and not encoder (unload) support. It should be fairly simple to add multi-file encoding support, because we do encode single TIFF files (just as standard baseline TIFF).

I am reopening this bug as a place holder for encoding multi-page TIFFs.
Comment 5 Craig Foote CLA 2010-03-03 14:56:31 EST
(In reply to comment #4)
> Note that I only added decoder (loader) support and not encoder (unload)
> support. It should be fairly simple to add multi-file encoding support, because
> we do encode single TIFF files (just as standard baseline TIFF).
> 
> I am reopening this bug as a place holder for encoding multi-page TIFFs.

Hi Carolyn,
Has your new code (for decoding multi-page TIFFS) been released yet? When can I expect to be able to use it. BTW, thanks.

Craig
Comment 6 Craig Foote CLA 2011-10-12 15:21:27 EDT
(In reply to comment #5)
> (In reply to comment #4)
> > Note that I only added decoder (loader) support and not encoder (unload)
> > support. It should be fairly simple to add multi-file encoding support, because
> > we do encode single TIFF files (just as standard baseline TIFF).
> > 
> > I am reopening this bug as a place holder for encoding multi-page TIFFs.
> 
> Hi Carolyn,
> Has your new code (for decoding multi-page TIFFS) been released yet? When can I
> expect to be able to use it. BTW, thanks.
> 
> Craig

bump?
Comment 7 Carolyn MacLeod CLA 2011-10-14 10:44:27 EDT
Sorry I didn't reply earlier. The code for decoding multi-page TIFFS has been in since fall 2009, which means it is in eclipse 3.6 and up. If it is not working for you, then it is possible that you need group iv tiff decoding, which is covered in bug 57382.

If you really do mean "encoding" (or "writing") of multi-page tiff, then this shouldn't be too difficult to add however I don't have time to work on it.

Lakshmi, do you have time?

All you have to do is refactor TIFFDirectory(image).writeToStream(outputStream) a bit so that the header is always written before calling writeToStream. Then call writeToStream for each image in the ImageLoader.data array. You also have to write the IFD offsets in the same way that they are read and used in the loadFromByteStream() method.

You can test using ImageAnalyzer example. Maybe open a multi-image (animated) gif and try saving it as multi-image tiff (and reading it back again).
Comment 8 Craig Foote CLA 2011-10-14 17:12:13 EDT
(In reply to comment #7)
> Sorry I didn't reply earlier. The code for decoding multi-page TIFFS has been
> in since fall 2009, which means it is in eclipse 3.6 and up. If it is not
> working for you, then it is possible that you need group iv tiff decoding,
> which is covered in bug 57382.
> 
> If you really do mean "encoding" (or "writing") of multi-page tiff, then this
> shouldn't be too difficult to add however I don't have time to work on it.
> 
> Lakshmi, do you have time?
> 
> All you have to do is refactor TIFFDirectory(image).writeToStream(outputStream)
> a bit so that the header is always written before calling writeToStream. Then
> call writeToStream for each image in the ImageLoader.data array. You also have
> to write the IFD offsets in the same way that they are read and used in the
> loadFromByteStream() method.
> 
> You can test using ImageAnalyzer example. Maybe open a multi-image (animated)
> gif and try saving it as multi-image tiff (and reading it back again).

Thanks Carolyn. I just need the decoding of the tiff into multiple SWT images. We don't actually write tiffs out but rather sometimes write jpgs of its pages. I'm very happy to hear it's been added and will report to my team that we should no longer need to convert to AWT images as intermediates. Thanks very much!

Craig
Comment 9 Carolyn MacLeod CLA 2011-10-17 15:49:53 EDT
Wait! I tried your attached image - patent.tif - and we don't read it correctly. All I saw was 17 blank pages.

I ran tiffinfo on your tiff, and I see that all of the pages in it have group 4 (fax) encoding. Since this is not considered "Baseline TIFF" (i.e. it is one of the TIFF 6.0 extensions) we did not originally decode this type of tiff.

So you need bug 57382 to be fixed first.
Comment 10 Craig Foote CLA 2011-10-17 18:56:20 EDT
(In reply to comment #9)
> Wait! I tried your attached image - patent.tif - and we don't read it
> correctly. All I saw was 17 blank pages.
> 
> I ran tiffinfo on your tiff, and I see that all of the pages in it have group 4
> (fax) encoding. Since this is not considered "Baseline TIFF" (i.e. it is one of
> the TIFF 6.0 extensions) we did not originally decode this type of tiff.
> 
> So you need bug 57382 to be fixed first.

You are right on both counts. Oh well, back to using AWT intermediaries.
Comment 11 Lars Vogel CLA 2019-11-14 03:08:50 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

If the bug is still relevant, please remove the "stalebug" whiteboard tag.