You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@xmlgraphics.apache.org by bu...@apache.org on 2010/02/22 19:35:11 UTC

DO NOT REPLY [Bug 48797] New: EPS and PS files are too big

https://issues.apache.org/bugzilla/show_bug.cgi?id=48797

           Summary: EPS and PS files are too big
           Product: XMLGraphicsCommons
           Version: Trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: PostScript
        AssignedTo: general@xmlgraphics.apache.org
        ReportedBy: calixte.denizet@ac-rennes.fr


Created an attachment (id=25038)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=25038)
The patch

Hi,

I attach a patch (got with "svn diff") to reduce the size of ps and eps files
generated with a PSGraphics2D. I put very simples macros and gave the
possibility to disable clipping.

Best regards,

Calixte

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: general-help@xmlgraphics.apache.org


DO NOT REPLY [Bug 48797] [PATCH] Optimize EPS and PS file size

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48797

--- Comment #4 from Calixte Denizet <ca...@ac-rennes.fr> 2010-03-18 12:31:50 UTC ---
Hello all,

I agree with Jeremias too.

Calixte

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: general-help@xmlgraphics.apache.org


DO NOT REPLY [Bug 48797] [PATCH] Optimize EPS and PS file size

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48797

--- Comment #3 from Chris Bowditch <bo...@hotmail.com> 2010-03-18 12:23:34 UTC ---
Hi All,

I agree with Jeremias. This change should be optional, because the shorthands
make the Postscript difficult to read and debug.

Thanks,

Chris

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: general-help@xmlgraphics.apache.org


DO NOT REPLY [Bug 48797] [PATCH] Optimize EPS and PS file size

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48797

Jeremias Maerki <je...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO

--- Comment #2 from Jeremias Maerki <je...@apache.org> 2010-03-18 10:20:40 UTC ---
Thanks for your patch, Calixte. To produce smaller PS files, your patch makes
perfect sense. However, I'm wondering if we should not make it configurable
whether the standard commands or the short macros should be used. When
debugging PostScript I find it desirable not to have to memorize all the one or
two letter commands. Also, having the full commands in the Java source code
would also improve readability. I'm thinking about a translation method in
PSGenerator that converts the full commands to short ones if that is enabled
(probably true by default). Something like this:

public String command(String postscriptCommand);

when compact mode enabled:
command("setlinejoin") --> "LJ"
when compact mode disabled:
command("setlinejoin") --> "setlinejoin"

So before we apply Calixte's patch, I'd like to ask around for opinions on
this.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: general-help@xmlgraphics.apache.org


DO NOT REPLY [Bug 48797] [PATCH] Optimize EPS and PS file size

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48797

--- Comment #8 from Jeremias Maerki <je...@apache.org> 2010-03-18 15:36:37 UTC ---
Calixte, do you want to send a patch? Maybe a clever refactoring of
PDFGraphics2D could actually improve things in a better way. Currently, the
clipping shape is established for every shape operation which is why this
probably has such a big effect on file size. The "disableClipping" is just a
work-around but is not really fixing the problem, it would seem.

(In reply to comment #7)
> Jeremias,
> 
> You should put a setter in EPSTranscoder and PSTranscoder to enable or to
> disable the clipping (since the method disableClipping is available in
> AbstractPSDocumentGraphics2D). When clipping is disabled, I can divide by 2 the
> size of the generated ps,eps.
> 
> Thanks a lot...
> 
> Calixte

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: general-help@xmlgraphics.apache.org


DO NOT REPLY [Bug 48797] [PATCH] Optimize EPS and PS file size

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48797

--- Comment #9 from Calixte Denizet <ca...@ac-rennes.fr> 2010-03-18 16:45:14 UTC ---
(In reply to comment #8)
> Calixte, do you want to send a patch? Maybe a clever refactoring of
> PDFGraphics2D could actually improve things in a better way. Currently, the
> clipping shape is established for every shape operation which is why this
> probably has such a big effect on file size. The "disableClipping" is just a
> work-around but is not really fixing the problem, it would seem.
> 

I'm not sure that "disableClipping" is just a workaround... that depends of
what you draw. In my case, the clipping shape is determinated as the bounding
box of my datas, so I know that what I draw is always included in the clipping
shape, so no need to check and to consume resources !

I agree with you when you don't really know what you draw : a solution could be
to make the clipping on the Java side and to send the "clipped" object to the
PS writer. If you want I can work on this solution and send you a patch, it
could be an interesting feature... I'll look at PDFGraphics2D...

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: general-help@xmlgraphics.apache.org


DO NOT REPLY [Bug 48797] [PATCH] Optimize EPS and PS file size

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48797

Helder Magalhães <he...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |PatchAvailable
                URL|                            |http://mail-archives.apache
                   |                            |.org/mod_mbox/xmlgraphics-g
                   |                            |eneral/201002.mbox/%3Cdfb11
                   |                            |3433353c8d2.4b814800@ac-ren
                   |                            |nes.fr%3E
            Summary|EPS and PS files are too    |[PATCH] Optimize EPS and PS
                   |big                         |file size
           Severity|normal                      |enhancement

--- Comment #1 from Helder Magalhães <he...@gmail.com> 2010-02-22 21:35:26 UTC ---
(In reply to comment #0)
> Created an attachment (id=25038)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=25038) [details]
> The patch
[...]
> I attach a patch (got with "svn diff") to reduce the size of ps and eps files
> generated with a PSGraphics2D. I put very simples macros [...]

Great! :-)  I guess it's better to state that this was already somehow
discussed in the mailing list (bug's URL set to the specific thread).

I'm also slightly rephrasing the summary and adding metadata to reflect a patch
(which was already lightly reviewed) being available.


> and gave the
> possibility to disable clipping.

Will this require some sort of documentation aside from the JavaDoc?


> Best regards,
> 
> Calixte

Thanks,
 Helder

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: general-help@xmlgraphics.apache.org


DO NOT REPLY [Bug 48797] [PATCH] Optimize EPS and PS file size

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48797

--- Comment #7 from Calixte Denizet <ca...@ac-rennes.fr> 2010-03-18 15:21:21 UTC ---
Jeremias,

You should put a setter in EPSTranscoder and PSTranscoder to enable or to
disable the clipping (since the method disableClipping is available in
AbstractPSDocumentGraphics2D). When clipping is disabled, I can divide by 2 the
size of the generated ps,eps.

Thanks a lot...

Calixte

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: general-help@xmlgraphics.apache.org


DO NOT REPLY [Bug 48797] [PATCH] Optimize EPS and PS file size

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48797

--- Comment #5 from Max Berger <ma...@berger.name> 2010-03-18 13:25:58 UTC ---
Jeremias,

since you ask for it, here are my 2cts:

yes, the switch you mention makes sense, but I'd prefer it the other way round:
Default should be smallest size, and the longer option could be "debug" or
"verbose". Why? Because most people don't manually debug PostScript, but want
to send it to their printer.

Max

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: general-help@xmlgraphics.apache.org


DO NOT REPLY [Bug 48797] [PATCH] Optimize EPS and PS file size

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48797

Jeremias Maerki <je...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |RESOLVED
         Resolution|                            |FIXED

--- Comment #6 from Jeremias Maerki <je...@apache.org> 2010-03-18 15:08:49 UTC ---
Patch applied with modifications:
http://svn.apache.org/viewvc?view=revision&revision=924840

Thank you all for your quick comments. Since there were already 3 positive
comments on this, I've added the option more or less as proposed.
Max, we were actually on the same page (compact shall be default).

Thanks, Calixte, for getting the ball rolling.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: general-help@xmlgraphics.apache.org