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


2014-02-28 2:16 GMT+01:00 Cley Faye <cleyfaye@gmail.com>:

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.odtfor 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 :)


​For the curious ones, I put this "tool" on github (binary & source) :
<https://github.com/CleyFaye/LOFiles/releases/tag/v0.1-alpha>​

This kind of tool is particularly useful if you're working with high-res
images, but intend to produce output at lower res. This way, you can keep
your original, and generate a file with images adequate for printing at
150dpi, another adapted to 90dpi, etc...

​As said, it should not damage anything; the worst outcome​ possible is the
output file being incorrect, so as long as you don't choose to save over an
existing file, you should be safe to try. If there is a high demand I might
keep on improving the code... :-) maybe also expand it with more tools,
like basic recovery of damaged files, things like that.

-- 
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.