Where can i set the image quality for my pdf

19 views
Skip to first unread message

deepc

unread,
Jun 3, 2009, 5:04:01 AM6/3/09
to mwlib
Is there a possibility to set the image quality for the pdf?
I use mwlib with mediawiki extension collection an the downscaling is
really terrible.

thx
Felix

Volker Haas

unread,
Jun 3, 2009, 8:09:18 AM6/3/09
to mw...@googlegroups.com
Hi Felix,
unfortunately this is currently either hard or impossible:

Image sizes can only be modified if you have your own renderserver. Even
then its a little hackish. You have to modify the mw-render call in
mw-serve: add the option -i (--IMAGESIZE) with the desired width in
which images are fetched.

Regards,
Volker
--
volker haas brainbot technologies ag
fon +49 6131 2116394 boppstraße 64
fax +49 6131 2116392 55118 mainz
volke...@brainbot.com http://www.brainbot.com/

Ralf Schmitt

unread,
Jun 3, 2009, 8:21:04 AM6/3/09
to mw...@googlegroups.com
On Wed, Jun 3, 2009 at 2:09 PM, Volker Haas <volke...@brainbot.com> wrote:
>
> Hi Felix,
> unfortunately this is currently either hard or impossible:
>
> Image sizes can only be modified if you have your own renderserver. Even
> then its a little hackish. You have to modify the mw-render call in
> mw-serve: add the option -i (--IMAGESIZE) with the desired width in
> which images are fetched.
>

I think this currently does *not* work. The imgagesize option is not
handled in fetch.py.

Ralf Schmitt

unread,
Jun 3, 2009, 8:24:52 AM6/3/09
to mw...@googlegroups.com

fixed in hg repo: http://code.pediapress.com/hg/mwlib/rev/e330a52ebe40
sorry for the noise.

deepc

unread,
Jun 3, 2009, 9:25:52 AM6/3/09
to mwlib
OK,
where exactly can i define --imagesize in mw-serve?
i just checked mw-serve --help and there is no option --imagesize.
mw-render has --imagesize but i don't now how to define it there.
i user mw-serve as standalone server with http connectivity for the
wiki.
in the startup i can't define --imagesize, when i tried the server
didn't startup.

thx
felix
> volker.h...@brainbot.com    http://www.brainbot.com/

Johannes Beigel

unread,
Jun 3, 2009, 10:13:35 AM6/3/09
to mw...@googlegroups.com
On 03.06.2009, at 15:25, deepc wrote:
> where exactly can i define --imagesize in mw-serve?

This is currently only possible by changing the source code of mwlib/
serve.py. You have to add the --imagesize option to the array of
options passed to mw-render and mw-zip. This, for example, is the
change needed for the call to mw-render:

diff -r e330a52ebe40 mwlib/serve.py
--- a/mwlib/serve.py Wed Jun 03 14:04:48 2009 +0200
+++ b/mwlib/serve.py Wed Jun 03 16:11:41 2009 +0200
@@ -293,6 +293,7 @@
'--writer', writer,
'--output', output_path,
'--pid-file', pid_path,
+ '--imagesize', '1600',
]

zip_path = self.get_path(collection_id, self.zip_filename)

-- Johannes

sl contrib

unread,
Jun 5, 2009, 10:08:05 AM6/5/09
to mw...@googlegroups.com
Hi all,

I just wanted to add to this conversation: Being able to put in an image size is a good feature. 

I am interested in the book-extension/mwlib from a low bandwidth accessibility point of view. So of course being able to download a pdf/odt etc in the first place is a good thing, and it makes mediawiki content much more accessible.

But it would also be nice if you could generate "optimised pdf": being able to use screen resolution images (or lower) would be a good step towards this. In fact, a option to exclude images would be good too: Images consume a lot of ink, which in poorer areas is a concern!

Of course it's not easy (as the thread explains), but perhaps it can be put in as a feature request somewhere?

All the best,
Bjoern

deepc

unread,
Jun 8, 2009, 10:17:43 AM6/8/09
to mwlib
After i made an update to mwlib.rl 0.10.3 i was able to see a
difference.
Is there a parameter to set compression rate?

Thx Felix

On 3 Jun., 16:13, Johannes Beigel <johannes.bei...@brainbot.com>
wrote:

Volker Haas

unread,
Jun 10, 2009, 6:32:28 AM6/10/09
to mw...@googlegroups.com
Hi Felix,

it is not possible to set/change the compression rate for images. The
"original" images are currently embedded in the PDF and not altered in
any way.

Regards,
Volker

deepc wrote:
> After i made an update to mwlib.rl 0.10.3 i was able to see a
> difference.
> Is there a parameter to set compression rate?
>
> Thx Felix
>
>

--

volker haas brainbot technologies ag
fon +49 6131 2116394 boppstraße 64
fax +49 6131 2116392 55118 mainz

volke...@brainbot.com http://www.brainbot.com/

Volker Haas

unread,
Jun 10, 2009, 6:37:56 AM6/10/09
to mw...@googlegroups.com


sl contrib wrote:
> Hi all,
[...]
> But it would also be nice if you could generate "optimised pdf": being
> able to use screen resolution images (or lower) would be a good step
> towards this. In fact, a option to exclude images would be good too:
> Images consume a lot of ink, which in poorer areas is a concern!
>
Excluding images can be done by using the option '--noimages' in the
same way as changing the size. Of course the problem is that this is a
"global" option valid for all pdfs.

Adding customization options to the interface is something will
implement sometime in the future. See

* http://code.pediapress.com/wiki/ticket/419

for details

> Of course it's not easy (as the thread explains), but perhaps it can
> be put in as a feature request somewhere?
Tickets about resizing images:

* http://code.pediapress.com/wiki/ticket/463
* http://code.pediapress.com/wiki/ticket/505

Regards,
Volker
>
> All the best,
> Bjoern
>
>
> On Wed, Jun 3, 2009 at 3:13 PM, Johannes Beigel
> <johanne...@brainbot.com <mailto:johanne...@brainbot.com>>
> wrote:
>
>
> On 03.06.2009, at 15:25, deepc wrote:
> > where exactly can i define --imagesize in mw-serve?
>
> This is currently only possible by changing the source code of mwlib/
> serve.py. You have to add the --imagesize option to the array of
> options passed to mw-render and mw-zip. This, for example, is the
> change needed for the call to mw-render:
>
> diff -r e330a52ebe40 mwlib/serve.py
> --- a/mwlib/serve.py Wed Jun 03 14:04:48 2009 +0200
> +++ b/mwlib/serve.py Wed Jun 03 16:11:41 2009 +0200
> @@ -293,6 +293,7 @@
> '--writer', writer,
> '--output', output_path,
> '--pid-file', pid_path,
> + '--imagesize', '1600',
> ]
>
> zip_path = self.get_path(collection_id, self.zip_filename)
>
> -- Johannes
>
>
>
>
>
> >

--
volker haas brainbot technologies ag
fon +49 6131 2116394 boppstraße 64
fax +49 6131 2116392 55118 mainz
volke...@brainbot.com http://www.brainbot.com/

Reply all
Reply to author
Forward
0 new messages