Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » View multipage tiffs in SWT?
View multipage tiffs in SWT? [message #445262] Sun, 31 October 2004 05:34 Go to next message
Eclipse UserFriend
Originally posted by: ukalumni.hotmail.com

I'm building a viewer that will load faxes received by a fax server.
Multipage faxes are saved as multipage tiffs. Is there some way to
handle this in SWT?

I need to alert the user if there is more than one page.
I need to be able to display the different pages.
I need to be able to delete individual pages.

I understand this may be beyond the scope of SWT, and if so, I'll use
ImageMagick to convert the tiffs to jpgs, which will separate the
multipage tiffs into individual jpgs.

However, if there is some way to do this in SWT, it would save me a
considerable amount of complexity.

Thanks,
--Michael
Re: View multipage tiffs in SWT? [message #445280 is a reply to message #445262] Mon, 01 November 2004 15:28 Go to previous messageGo to next message
Christophe Cornu is currently offline Christophe CornuFriend
Messages: 304
Registered: July 2009
Senior Member
Hi Michael,

SWT provides a baseline TIFF reader - it only reads the first image so this
won't fit your needs.
Please open a feature request (Bugzilla, SWT) and attach one of your TIFF
files with multiple images. We can look into reading each TIFF subfile in
the future.

Thank you,
Chris
Re: View multipage tiffs in SWT? [message #445281 is a reply to message #445280] Mon, 01 November 2004 15:50 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ukalumni.hotmail.com

Christophe Cornu wrote:
> Hi Michael,
>
> SWT provides a baseline TIFF reader - it only reads the first image so this
> won't fit your needs.
> Please open a feature request (Bugzilla, SWT) and attach one of your TIFF
> files with multiple images. We can look into reading each TIFF subfile in
> the future.
>
> Thank you,
> Chris
>
>
Thanks very much for your response. As I said, I realize that is out of
scope for SWT, but I'll enter a feature request.

Thanks,
--Michael
Re: View multipage tiffs in SWT? [message #445412 is a reply to message #445262] Fri, 05 November 2004 11:25 Go to previous message
Eclipse UserFriend
Originally posted by: dominikg.vr-web.de

You can use the JAI (Java Advanced Imaging) Libraries from Sun.
http://java.sun.com/products/java-media/jai/index.jsp

Perhaps this code snippet will help you.

ArrayList images =3D new ArrayList();

File file =3D new File("C:\\test.tiff");
SeekableStream s =3D new FileSeekableStream(file);
TIFFDecodeParam param =3D null;
ImageDecoder dec =3D ImageCodec.createImageDecoder("tiff", s, param);

imageCount =3D dec.getNumPages();
String formatName =3D "JPG";

for (int i =3D 0; i < imageCount; i++) {
RenderedImage ri =3D dec.decodeAsRenderedImage(i);

ByteArrayOutputStream out =3D new ByteArrayOutputStream();
boolean writerExists =3D ImageIO.write(ri, formatName, out);
if (!writerExists) {
throw new IOException("Illegal ImageFormat: " + formatName);
}
ByteArrayInputStream in =3D new ByteArrayInputStream(out.toByteArray()=
);

images.add(new Image(parent.getDisplay(), in));
}


Dominik

Am Sun, 31 Oct 2004 00:34:58 -0500 schrieb Michael Molloy =

<ukalumni@hotmail.com>:

> I'm building a viewer that will load faxes received by a fax server. =

> Multipage faxes are saved as multipage tiffs. Is there some way to =

> handle this in SWT?
>
> I need to alert the user if there is more than one page.
> I need to be able to display the different pages.
> I need to be able to delete individual pages.
>
> I understand this may be beyond the scope of SWT, and if so, I'll use =

> ImageMagick to convert the tiffs to jpgs, which will separate the =

> multipage tiffs into individual jpgs.
>
> However, if there is some way to do this in SWT, it would save me a =

> considerable amount of complexity.
>
> Thanks,
> --Michael



-- =

Erstellt mit M2, Operas revolution=E4rem E-Mail-Modul: =

http://www.opera.com/m2/
Previous Topic:OLE and Microsoft word
Next Topic:Continue the control resize problem, Can anyone tell me that whether or not the nested composite hav
Goto Forum:
  


Current Time: Thu Apr 25 23:52:03 GMT 2024

Powered by FUDForum. Page generated in 0.03284 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top