Date: prev next · Thread: first prev next last
2014 Archives by date, by thread · List index


2014-02-27 23:28 GMT+01:00 Dale Rebgetz <dale.rebgetz@setec.com.au>:

I too am very familiar with the various third party methods mentioned
below, but we must try to address the problem from the point of view of the
OP. He was made aware of a very simple tool in Word that did exactly what
he wanted. *How* it achieved it appeared to be of no interest. He was
asking about the possible existence of a similar tool in LO.

Personally I believe LO needs an equivalent tool, because most of the
people whom we are trying to convert to LO/OO have no knowledge and no
interest in the round-about methods detailed below. If there was an easy
method to perform automatic or one-click cropping and resolution reduction
*after* the document was compiled, why wouldn't that be the preferred
method for all users, regardless of their competency with other editing
tools?


Hm. Probably because there is no "obvious" way to do it that would combine:
- ease of use
- efficiency in all case
- low development cost

I don't know how often this feature is requested for odt files. I know that
for pdf you can set parameters for the image compression, and it make sense
since the resulting file is unlikely to undergo future changes, but it's
less obvious for file formats that are not at the "end" of the editing
line. It's probably better to work with the "highest" resolution needed,
and produce smaller files as needed. Hmm.

As a "proof of concept", I put together a java program that take an odt
file as input. You can then set the "requested" DPI and jpeg quality, and
save. At this point, every pictures that are larger than needed (that's why
we need DPI) are resized, and all pictures are compressed using either jpg
or png, whichever gives the smalles size. Something as simple as that
already have issues, like when there's transparency involved.
Also, it's only tested on a few files (including
https://wiki.documentfoundation.org/images/9/96/WG40-WriterGuideLO.odt for
funsies).

If anyone want to give it a try here's the jar. It's highly unlikely to
corrupt your source file (the source file is never ever written), but
there's also no guarantee that the output will work ;)
<http://cleyfaye.net/share/odtcompress.jar>
For example, on the writer guide linked before, it goes from 13MB to 9MB
with default settings. Of course it's not the best example: all pictures
are already reasonably sized, and it's mostly screenshots so the quality
drop is very noticeable...

Anyway, if anyone want to look at the source code (without reversing the
jar :D) I'll provide them. But know that it's mostly an ugly hack just to
see how well it would work :)

-- 
To unsubscribe e-mail to: users+unsubscribe@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.