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 Eric Dalquist <eb...@mtu.edu> on 2001/09/15 00:58:44 UTC

[PATCH] JPG Compression

Attached is the diff for the patch. This is going against the latest release
build. When reading the diff "G:\Fop-0.20.1\Fop-0.20.1-clean" is the
untouched distribution "G:\Fop-0.20.1\Fop-0.20.1-dev" is the modified
distribution. It should work y just copying over the attached files and then
deleting src/org/apache/image/GifJpegImage.java since it will not be in use.
If I need to follow this up in any way I'll try my best to help. I hope one
of the commiters can look at this and deem it worthy to patch FOP.

-Eric B Dalquist

Re: [PATCH] JPG Compression

Posted by Jeremias Maerki <je...@outline.ch>.
One is already there: examples/fo/images.fo. PDF came down from 28KB to
17KB. Great work, Eric!!! And thanks to Keiron for taking it into CVS.


On Tue, 18 Sep 2001 10:29:19 +0200 Keiron Liddle wrote:
> Eric,
> 
> I have committed the patch since it looks to be working ok and there seems
> to be a general consensus that it is a good thing.
> 
> Of course if possible it would be good for people to supply some test
> examples.
> 
> Keiron.
> 
> On Mon, 17 Sep 2001 19:47:40 Eric Dalquist wrote:
> > Jim,
> > 
> > I found the bug. I imagine this isn't the last time something like this
> > will
> > come up. JPEGs use a fairly simple header setup to store pertinent
> > information in the image. The JPEG standard says the image width, height
> > and
> > color depth should be stored in the FFC0 header the jpeg you have stored
> > the
> > info in a FFC2 header which I had not heard of. It seems there are many
> > flavors of jpeg so little fixes like this may be happening for a while.
> > Attached is a new JpegImage.java which will fix the problem. If you're
> > interested the change was made on line 81.
> > 
> > -Eric Dalquist
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
> For additional commands, email: fop-dev-help@xml.apache.org

Cheers,
OUTLINE AG
Jeremias Märki

mailto:jeremias.maerki@outline.ch

Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern
Fon +41 (41) 317 2020 - Fax +41 (41) 317 2029
Internet http://www.outline.ch


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


Re: [PATCH] JPG Compression

Posted by Eric Dalquist <eb...@mtu.edu>.
I'll see if I can write up a test example tomorrow afternoon for it.

-Eric Dalquist

----- Original Message -----
From: "Keiron Liddle" <ke...@aftexsw.com>
To: <fo...@xml.apache.org>
Sent: Tuesday, September 18, 2001 4:29 AM
Subject: Re: [PATCH] JPG Compression


> Eric,
>
> I have committed the patch since it looks to be working ok and there seems
> to be a general consensus that it is a good thing.
>
> Of course if possible it would be good for people to supply some test
> examples.
>
> Keiron.
>
> On Mon, 17 Sep 2001 19:47:40 Eric Dalquist wrote:
> > Jim,
> >
> > I found the bug. I imagine this isn't the last time something like this
> > will
> > come up. JPEGs use a fairly simple header setup to store pertinent
> > information in the image. The JPEG standard says the image width, height
> > and
> > color depth should be stored in the FFC0 header the jpeg you have stored
> > the
> > info in a FFC2 header which I had not heard of. It seems there are many
> > flavors of jpeg so little fixes like this may be happening for a while.
> > Attached is a new JpegImage.java which will fix the problem. If you're
> > interested the change was made on line 81.
> >
> > -Eric Dalquist
>
> ---------------------------------------------------------------------
> 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: [PATCH] JPG Compression

Posted by Keiron Liddle <ke...@aftexsw.com>.
Eric,

I have committed the patch since it looks to be working ok and there seems
to be a general consensus that it is a good thing.

Of course if possible it would be good for people to supply some test
examples.

Keiron.

On Mon, 17 Sep 2001 19:47:40 Eric Dalquist wrote:
> Jim,
> 
> I found the bug. I imagine this isn't the last time something like this
> will
> come up. JPEGs use a fairly simple header setup to store pertinent
> information in the image. The JPEG standard says the image width, height
> and
> color depth should be stored in the FFC0 header the jpeg you have stored
> the
> info in a FFC2 header which I had not heard of. It seems there are many
> flavors of jpeg so little fixes like this may be happening for a while.
> Attached is a new JpegImage.java which will fix the problem. If you're
> interested the change was made on line 81.
> 
> -Eric Dalquist

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


RE: [PATCH] JPG Compression

Posted by Jim Wright <jw...@palgraphics.com>.
That's very cool.

Thanks, Eric!

jw

-----Original Message-----
From: Eric Dalquist [mailto:ebdalqui@mtu.edu]
Sent: Monday, September 17, 2001 12:48 PM
To: fop-dev@xml.apache.org
Subject: Re: [PATCH] JPG Compression


Jim,

I found the bug. I imagine this isn't the last time something like this will
come up. JPEGs use a fairly simple header setup to store pertinent
information in the image. The JPEG standard says the image width, height and
color depth should be stored in the FFC0 header the jpeg you have stored the
info in a FFC2 header which I had not heard of. It seems there are many
flavors of jpeg so little fixes like this may be happening for a while.
Attached is a new JpegImage.java which will fix the problem. If you're
interested the change was made on line 81.

-Eric Dalquist

----- Original Message -----
From: "Jim Wright" <jw...@palgraphics.com>
To: <fo...@xml.apache.org>
Sent: Sunday, September 16, 2001 11:01 PM
Subject: RE: [PATCH] JPG Compression


> Hey Eric:
>
> Been working with the patched stuff on and off all day -- still looks
great!
>
> Attached is a rather junky macintosh-based jpg that demonstrates the
header
> problem. Let me know if you get a fix. Either way, thanks again for the
> patch!
>
> jw
>
> -----Original Message-----
> From: Eric Dalquist [mailto:ebdalqui@mtu.edu]
> Sent: Saturday, September 15, 2001 4:42 PM
> To: fop-dev@xml.apache.org
> Subject: Re: [PATCH] JPG Compression
>


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


RE: [PATCH] JPG Compression

Posted by Jim Wright <jw...@palgraphics.com>.
Eric:

Latest patch does seem to solve the current header problem quite nicely.

Thanks!

jw

-----Original Message-----
From: Eric Dalquist [mailto:ebdalqui@mtu.edu]
Sent: Monday, September 17, 2001 12:48 PM
To: fop-dev@xml.apache.org
Subject: Re: [PATCH] JPG Compression


Jim,

I found the bug. I imagine this isn't the last time something like this will
come up. JPEGs use a fairly simple header setup to store pertinent
information in the image. The JPEG standard says the image width, height and
color depth should be stored in the FFC0 header the jpeg you have stored the
info in a FFC2 header which I had not heard of. It seems there are many
flavors of jpeg so little fixes like this may be happening for a while.
Attached is a new JpegImage.java which will fix the problem. If you're
interested the change was made on line 81.

-Eric Dalquist

----- Original Message -----
From: "Jim Wright" <jw...@palgraphics.com>
To: <fo...@xml.apache.org>
Sent: Sunday, September 16, 2001 11:01 PM
Subject: RE: [PATCH] JPG Compression


> Hey Eric:
>
> Been working with the patched stuff on and off all day -- still looks
great!
>
> Attached is a rather junky macintosh-based jpg that demonstrates the
header
> problem. Let me know if you get a fix. Either way, thanks again for the
> patch!
>
> jw
>
> -----Original Message-----
> From: Eric Dalquist [mailto:ebdalqui@mtu.edu]
> Sent: Saturday, September 15, 2001 4:42 PM
> To: fop-dev@xml.apache.org
> Subject: Re: [PATCH] JPG Compression
>


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


RE: [PATCH] JPG Compression

Posted by Jim Wright <jw...@palgraphics.com>.
Eric:

More specifically, the header from Photoshop 6.0 for Windows seems to work
the most reliably. Other Photoshop versions will sometimes give the error.

I've yet to install the latest update, but will do so, and test. I'll let
you know how it works out.

Otherwise, the patch seems to be holding up quite well. In an existing FOP
install, we've passed close to 80 or so different images through, all of
which worked very well.

I can't speak to Daniel Pfuhl's issue of longer XSL documents as ours, while
fairly graphics intensive, are only 4-8 pages in length, and the XSL
documents are not all that huge.

Thanks again!

jw

-----Original Message-----
From: Eric Dalquist [mailto:ebdalqui@mtu.edu]
Sent: Monday, September 17, 2001 12:48 PM
To: fop-dev@xml.apache.org
Subject: Re: [PATCH] JPG Compression


Jim,

I found the bug. I imagine this isn't the last time something like this will
come up. JPEGs use a fairly simple header setup to store pertinent
information in the image. The JPEG standard says the image width, height and
color depth should be stored in the FFC0 header the jpeg you have stored the
info in a FFC2 header which I had not heard of. It seems there are many
flavors of jpeg so little fixes like this may be happening for a while.
Attached is a new JpegImage.java which will fix the problem. If you're
interested the change was made on line 81.

-Eric Dalquist

----- Original Message -----
From: "Jim Wright" <jw...@palgraphics.com>
To: <fo...@xml.apache.org>
Sent: Sunday, September 16, 2001 11:01 PM
Subject: RE: [PATCH] JPG Compression


> Hey Eric:
>
> Been working with the patched stuff on and off all day -- still looks
great!
>
> Attached is a rather junky macintosh-based jpg that demonstrates the
header
> problem. Let me know if you get a fix. Either way, thanks again for the
> patch!
>
> jw
>
> -----Original Message-----
> From: Eric Dalquist [mailto:ebdalqui@mtu.edu]
> Sent: Saturday, September 15, 2001 4:42 PM
> To: fop-dev@xml.apache.org
> Subject: Re: [PATCH] JPG Compression
>


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


Re: [PATCH] JPG Compression

Posted by Eric Dalquist <eb...@mtu.edu>.
Jim,

I found the bug. I imagine this isn't the last time something like this will
come up. JPEGs use a fairly simple header setup to store pertinent
information in the image. The JPEG standard says the image width, height and
color depth should be stored in the FFC0 header the jpeg you have stored the
info in a FFC2 header which I had not heard of. It seems there are many
flavors of jpeg so little fixes like this may be happening for a while.
Attached is a new JpegImage.java which will fix the problem. If you're
interested the change was made on line 81.

-Eric Dalquist

----- Original Message -----
From: "Jim Wright" <jw...@palgraphics.com>
To: <fo...@xml.apache.org>
Sent: Sunday, September 16, 2001 11:01 PM
Subject: RE: [PATCH] JPG Compression


> Hey Eric:
>
> Been working with the patched stuff on and off all day -- still looks
great!
>
> Attached is a rather junky macintosh-based jpg that demonstrates the
header
> problem. Let me know if you get a fix. Either way, thanks again for the
> patch!
>
> jw
>
> -----Original Message-----
> From: Eric Dalquist [mailto:ebdalqui@mtu.edu]
> Sent: Saturday, September 15, 2001 4:42 PM
> To: fop-dev@xml.apache.org
> Subject: Re: [PATCH] JPG Compression
>

RE: [PATCH] JPG Compression

Posted by Jim Wright <jw...@palgraphics.com>.
Hey Eric:

Been working with the patched stuff on and off all day -- still looks great!

Attached is a rather junky macintosh-based jpg that demonstrates the header
problem. Let me know if you get a fix. Either way, thanks again for the
patch!

jw

-----Original Message-----
From: Eric Dalquist [mailto:ebdalqui@mtu.edu]
Sent: Saturday, September 15, 2001 4:42 PM
To: fop-dev@xml.apache.org
Subject: Re: [PATCH] JPG Compression


Jim,

If you could please email me one of those jpegs it is erroring off on I'll
look into the reasons. A fix shouldn't be too hard. I forbgot all about
those System.out.println(); calls I had ... thos can be removed.

-Eric Dalquist


----- Original Message -----
From: "Jim Wright" <jw...@palgraphics.com>
To: <fo...@xml.apache.org>
Sent: Saturday, September 15, 2001 12:32 PM
Subject: RE: [PATCH] JPG Compression


> Wow!
>
> That works like a charm! Thanks a lot, Eric.
>
> In my preliminary tests, Eric's patch moved a pdf with 6 heavily
compressed
> jpgs from over 950 K to just over 50K! Rendering times seem just about as
> fast, but, more importantly, web users will receive the file that much
> faster. Very cool stuff.
>
> I noticed only a few small problems: First, the renderer does not
recognize
> jpg headers generated by Macintosh Photoshop (it throws a "bad jpg header"
> message). Simply resaving the files in Windows Photoshop solved this.
Also,
> there are a few System.out.printlns that probably won't be needed in final
> release, but may be good for testing.
>
> What can we do to get this in the next release? I'll help out where I can,
> as the patch really moves the functionality of FOP forward.
>
> Thanks again, Eric.
>
> jw
>
> -----Original Message-----
> From: Eric Dalquist [mailto:ebdalqui@mtu.edu]
> Sent: Friday, September 14, 2001 5:59 PM
> To: fop-dev@xml.apache.org
> Subject: [PATCH] JPG Compression
>
>
> Attached is the diff for the patch. This is going against the latest
release
> build. When reading the diff "G:\Fop-0.20.1\Fop-0.20.1-clean" is the
> untouched distribution "G:\Fop-0.20.1\Fop-0.20.1-dev" is the modified
> distribution. It should work y just copying over the attached files and
then
> deleting src/org/apache/image/GifJpegImage.java since it will not be in
use.
> If I need to follow this up in any way I'll try my best to help. I hope
one
> of the commiters can look at this and deem it worthy to patch FOP.
>
> -Eric B Dalquist
>
>
> ---------------------------------------------------------------------
> 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: [PATCH] JPG Compression

Posted by Eric Dalquist <eb...@mtu.edu>.
Jim,

If you could please email me one of those jpegs it is erroring off on I'll
look into the reasons. A fix shouldn't be too hard. I forbgot all about
those System.out.println(); calls I had ... thos can be removed.

-Eric Dalquist


----- Original Message -----
From: "Jim Wright" <jw...@palgraphics.com>
To: <fo...@xml.apache.org>
Sent: Saturday, September 15, 2001 12:32 PM
Subject: RE: [PATCH] JPG Compression


> Wow!
>
> That works like a charm! Thanks a lot, Eric.
>
> In my preliminary tests, Eric's patch moved a pdf with 6 heavily
compressed
> jpgs from over 950 K to just over 50K! Rendering times seem just about as
> fast, but, more importantly, web users will receive the file that much
> faster. Very cool stuff.
>
> I noticed only a few small problems: First, the renderer does not
recognize
> jpg headers generated by Macintosh Photoshop (it throws a "bad jpg header"
> message). Simply resaving the files in Windows Photoshop solved this.
Also,
> there are a few System.out.printlns that probably won't be needed in final
> release, but may be good for testing.
>
> What can we do to get this in the next release? I'll help out where I can,
> as the patch really moves the functionality of FOP forward.
>
> Thanks again, Eric.
>
> jw
>
> -----Original Message-----
> From: Eric Dalquist [mailto:ebdalqui@mtu.edu]
> Sent: Friday, September 14, 2001 5:59 PM
> To: fop-dev@xml.apache.org
> Subject: [PATCH] JPG Compression
>
>
> Attached is the diff for the patch. This is going against the latest
release
> build. When reading the diff "G:\Fop-0.20.1\Fop-0.20.1-clean" is the
> untouched distribution "G:\Fop-0.20.1\Fop-0.20.1-dev" is the modified
> distribution. It should work y just copying over the attached files and
then
> deleting src/org/apache/image/GifJpegImage.java since it will not be in
use.
> If I need to follow this up in any way I'll try my best to help. I hope
one
> of the commiters can look at this and deem it worthy to patch FOP.
>
> -Eric B Dalquist
>
>
> ---------------------------------------------------------------------
> 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: [PATCH] JPG Compression

Posted by Jim Wright <jw...@palgraphics.com>.
Wow!

That works like a charm! Thanks a lot, Eric.

In my preliminary tests, Eric's patch moved a pdf with 6 heavily compressed
jpgs from over 950 K to just over 50K! Rendering times seem just about as
fast, but, more importantly, web users will receive the file that much
faster. Very cool stuff.

I noticed only a few small problems: First, the renderer does not recognize
jpg headers generated by Macintosh Photoshop (it throws a "bad jpg header"
message). Simply resaving the files in Windows Photoshop solved this. Also,
there are a few System.out.printlns that probably won't be needed in final
release, but may be good for testing.

What can we do to get this in the next release? I'll help out where I can,
as the patch really moves the functionality of FOP forward.

Thanks again, Eric.

jw

-----Original Message-----
From: Eric Dalquist [mailto:ebdalqui@mtu.edu]
Sent: Friday, September 14, 2001 5:59 PM
To: fop-dev@xml.apache.org
Subject: [PATCH] JPG Compression


Attached is the diff for the patch. This is going against the latest release
build. When reading the diff "G:\Fop-0.20.1\Fop-0.20.1-clean" is the
untouched distribution "G:\Fop-0.20.1\Fop-0.20.1-dev" is the modified
distribution. It should work y just copying over the attached files and then
deleting src/org/apache/image/GifJpegImage.java since it will not be in use.
If I need to follow this up in any way I'll try my best to help. I hope one
of the commiters can look at this and deem it worthy to patch FOP.

-Eric B Dalquist


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


external-graphic broken?

Posted by Torkild Ulvøy Resheim <tr...@online.no>.
I'm getting no protocol error when running this trough the CVS (as of today)/0.20.1 version of FOP. It used to work before.

<fo:external-graphic height="3.375cm" width="4.50cm">
  <xsl:attribute name="src">file:./client/data/<xsl:value-of select="$current-dsn"/>/<xsl:value-of select="picture"/></xsl:attribute>
</fo:external-graphic>


Any ideas?

~torkildR



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


RE: [PATCH] JPG Compression

Posted by Jim Wright <jw...@palgraphics.com>.
I'm going to give this a try straight away!

Thanks a lot.

jw

-----Original Message-----
From: Eric Dalquist [mailto:ebdalqui@mtu.edu]
Sent: Friday, September 14, 2001 5:59 PM
To: fop-dev@xml.apache.org
Subject: [PATCH] JPG Compression


Attached is the diff for the patch. This is going against the latest release
build. When reading the diff "G:\Fop-0.20.1\Fop-0.20.1-clean" is the
untouched distribution "G:\Fop-0.20.1\Fop-0.20.1-dev" is the modified
distribution. It should work y just copying over the attached files and then
deleting src/org/apache/image/GifJpegImage.java since it will not be in use.
If I need to follow this up in any way I'll try my best to help. I hope one
of the commiters can look at this and deem it worthy to patch FOP.

-Eric B Dalquist


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