You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Tore Engvig <te...@manamind.com> on 2001/11/16 19:18:37 UTC

Support for ICC profiles and CMYK jpeg

I've just added support for ICC profiles and CMYK jpeg's.
Source code, a prebuilt jop.jar and a test pdf can be found at
http://vaggen.net/~tengvig/fop/

Caveat: PhotoShop generates inverted cmyk jpegs. I've added a decode matrix
in PDFXObject to deal with it. Thus PhotoShop generated cmyk jpeg's will
look fine, but I guess cmyk jpegs generated from other applications will
become inverted. Does anyone have a clue how to check if a jpeg is inverted?

I've not added it to cvs yet, there are routing problems between me and the
cvs server (loop at iad1-lga1-oc192-2.iad1.above.net).


Tore


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


RE: Support for ICC profiles and CMYK jpeg

Posted by Arved Sandstrom <Ar...@chebucto.ns.ca>.
With reference to the inversion problem here is what the jpeg2ps manpage has
to say:

<quote>
Adobe Photoshop CMYK files

This is what the Independent JPEG Group has to say about Photoshop CMYK
files (quoted from libjpeg.doc, part of the IJG JPEG library):

CAUTION: it appears that Adobe Photoshop writes inverted data in CMYK JPEG
files: 0 represents 100% ink coverage, rather than 0% ink as you'd expect.
This is arguably a bug in Photoshop, but if you need to work with Photoshop
CMYK files, you will have to deal with it in your application. We cannot
"fix" this in the library by inverting the data during the CMYK<=>YCCK
transform, because that would break other applications, notably Ghostscript.
Photoshop versions prior to 3.0 write EPS files containing JPEG-encoded CMYK
data in the same inverted-YCCK representation used in bare JPEG files, but
the surrounding PostScript code performs an inversion using the PS image
operator. I am told that Photoshop 3.0 will write uninverted YCCK in
EPS/JPEG files, and will omit the PS-level inversion. (But the data polarity
used in bare JPEG files will not change in 3.0.) In either case, the JPEG
library must not invert the data itself, or else Ghostscript would read
these EPS files incorrectly.

Accordingly, jpeg2ps tries to detect such files (by looking for Adobes APP
marker) and inverts the colors in the case of 4-component images. This
inversion takes place in the PostScript setup instructions, not by changing
the image data.
</quote>

Regards,
Arved Sandstrom

-----Original Message-----
From: Thomas Kübler [mailto:t.kuebler@update.de]
Sent: January 16, 2002 5:46 AM
To: fop-dev@xml.apache.org
Subject: Re: Support for ICC profiles and CMYK jpeg


hallo,

your extension works fine, but every time when i rendered a eps, i have
to restart fop. I think the Input-Stream of the eps are not closed, so when
you start the fop again, fop cannot get the eps.

where i can look for this Problem?

p.s. are there any chance to get the Preview of the eps in the pdf-file?


by thomas kübler


----- Original Message -----
From: "Tore Engvig" <te...@manamind.com>
To: <fo...@xml.apache.org>
Sent: Friday, November 16, 2001 7:18 PM
Subject: Support for ICC profiles and CMYK jpeg


>
> I've just added support for ICC profiles and CMYK jpeg's.
> Source code, a prebuilt jop.jar and a test pdf can be found at
> http://vaggen.net/~tengvig/fop/
>
> Caveat: PhotoShop generates inverted cmyk jpegs. I've added a decode
matrix
> in PDFXObject to deal with it. Thus PhotoShop generated cmyk jpeg's will
> look fine, but I guess cmyk jpegs generated from other applications will
> become inverted. Does anyone have a clue how to check if a jpeg is
inverted?
>
> I've not added it to cvs yet, there are routing problems between me and
the
> cvs server (loop at iad1-lga1-oc192-2.iad1.above.net).
>
>
> Tore
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
> For additional commands, email: fop-dev-help@xml.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


RE: Support for ICC profiles and CMYK jpeg

Posted by Tore Engvig <te...@manamind.com>.
> hallo,
>
> your extension works fine, but every time when i rendered a eps, i have
> to restart fop. I think the Input-Stream of the eps are not
> closed, so when
> you start the fop again, fop cannot get the eps.
>
> where i can look for this Problem?

Not really sure where the proper place to close the stream are. I guess
adding a
baos.close() at the end of the readEPSImage method in
org.apache.fop.image.analyser.EPSReader might do it.

> p.s. are there any chance to get the Preview of the eps in the pdf-file?

I'ts possible but a little complicated. If I remeber correctly the preview
images can be wmf og tiff images. Fop only support tiff, so wmf previews
won't work anyway (unless someone voluteers to improve batik's WMFTranscoder
:). Also there are 2 methods to store a preview. Either as comments or as
binary data at the end. There is code in the EPSReader to extract the binary
tiff data, but it's not used.

It should be possible to use the binary tiff data, but it would be a little
messy. It's possible in pdf to have an alternate image with the preview as
the base image and the eps as the alternate (with DefaultForPrinting set to
true). The messy part appears when you want to add an image object (the
alternate) from an image (the base image). I also think you might have to
change the tiff image readers a little to make it work.

So, it's possible but a little (just a little!) messy to implement and will
only work for tiff binary previews.


Tore

>
>
> by thomas kübler
>
>
> ----- Original Message -----
> From: "Tore Engvig" <te...@manamind.com>
> To: <fo...@xml.apache.org>
> Sent: Friday, November 16, 2001 7:18 PM
> Subject: Support for ICC profiles and CMYK jpeg
>
>
> >
> > I've just added support for ICC profiles and CMYK jpeg's.
> > Source code, a prebuilt jop.jar and a test pdf can be found at
> > http://vaggen.net/~tengvig/fop/
> >
> > Caveat: PhotoShop generates inverted cmyk jpegs. I've added a decode
> matrix
> > in PDFXObject to deal with it. Thus PhotoShop generated cmyk jpeg's will
> > look fine, but I guess cmyk jpegs generated from other applications will
> > become inverted. Does anyone have a clue how to check if a jpeg is
> inverted?
> >
> > I've not added it to cvs yet, there are routing problems between me and
> the
> > cvs server (loop at iad1-lga1-oc192-2.iad1.above.net).
> >
> >
> > Tore
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
> > For additional commands, email: fop-dev-help@xml.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
> For additional commands, email: fop-dev-help@xml.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


Re: Support for ICC profiles and CMYK jpeg

Posted by Thomas Kübler <t....@update.de>.
hallo,

your extension works fine, but every time when i rendered a eps, i have
to restart fop. I think the Input-Stream of the eps are not closed, so when
you start the fop again, fop cannot get the eps.

where i can look for this Problem?

p.s. are there any chance to get the Preview of the eps in the pdf-file?


by thomas kübler


----- Original Message -----
From: "Tore Engvig" <te...@manamind.com>
To: <fo...@xml.apache.org>
Sent: Friday, November 16, 2001 7:18 PM
Subject: Support for ICC profiles and CMYK jpeg


>
> I've just added support for ICC profiles and CMYK jpeg's.
> Source code, a prebuilt jop.jar and a test pdf can be found at
> http://vaggen.net/~tengvig/fop/
>
> Caveat: PhotoShop generates inverted cmyk jpegs. I've added a decode
matrix
> in PDFXObject to deal with it. Thus PhotoShop generated cmyk jpeg's will
> look fine, but I guess cmyk jpegs generated from other applications will
> become inverted. Does anyone have a clue how to check if a jpeg is
inverted?
>
> I've not added it to cvs yet, there are routing problems between me and
the
> cvs server (loop at iad1-lga1-oc192-2.iad1.above.net).
>
>
> Tore
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
> For additional commands, email: fop-dev-help@xml.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org