1
1
mirror of https://github.com/Kozea/WeasyPrint.git synced 2024-10-05 08:27:22 +03:00
Commit Graph

108 Commits

Author SHA1 Message Date
Guillaume Ayoub
c56b96b3c1 Add an option to optimize embedded images size 2020-06-22 16:05:14 +02:00
Guillaume Ayoub
b40ad461be Remove repeated copyright assignments in files
Everything is replaced by a more explicit message in the COPYRIGHT file.

Inspired by rust-lang/rust#43498 and rust-lang/rust#57108.
2020-01-02 14:10:09 +01:00
Guillaume Ayoub
47ec97bcaf Remove useless explicit object inheritance 2020-01-02 12:06:58 +01:00
Guillaume Ayoub
4865b97a22 Remove useless super() arguments 2019-12-23 15:34:49 +01:00
Guillaume Ayoub
9f442be640 Move percentage function into percentages module 2019-06-02 18:06:25 +02:00
Manuel Barkhau
20afa51175 refactor: factor out "precentage" function 2019-06-01 01:39:40 +02:00
Guillaume Ayoub
37e788e8c3 Force SVG size
Related to #867.
2019-05-20 12:31:30 +02:00
Guillaume Ayoub
b7a9fe7dcc Update copyright 2019-03-04 11:04:06 +01:00
Guillaume Ayoub
56904baa79 Use the same copyright line everywhere 2018-09-20 18:46:27 +02:00
Guillaume Ayoub
d0f0490890 Remove dead and old code from tests 2018-03-12 19:02:17 +01:00
Guillaume Ayoub
16e8186568 Drop Python 2 support 2018-01-14 01:48:17 +01:00
Martijn The
38ac25b6e8 Bugfix: handle SVGs containing images embedded as data URIs
The `dict` returned from `open_data_url` does not contain a `file_obj` key. This line was throwing a key error before.
Fix: avoid accessing the non-existent key.

Fixes #529.
2017-11-11 14:21:16 +01:00
Guillaume Ayoub
89f008eab4 Fix lint, don't use except without exception class 2017-10-24 22:08:49 +02:00
Guillaume Ayoub
fcd6bf7070 Clean and document the logging levels
Related to #488.
2017-07-25 13:59:56 +02:00
Guillaume Ayoub
c74b206abb Fix the use of WeasyPrint's URL fetcher with CairoSVG 2017-06-23 12:23:22 +02:00
Guillaume Ayoub
86e4c63f4a Try to use WeasyPrint's URL fetcher in CairoSVG
Related to Kozea/Flask-WeasyPrint#11.
2017-06-07 11:37:53 +02:00
Guillaume Ayoub
4f4b4ed598 Use isort in tests 2017-03-25 00:33:36 +01:00
Guillaume Ayoub
521173b771 Try to render images as SVG first when sniffing 2016-11-21 09:29:55 +01:00
Guillaume Ayoub
e22e548674 Cut long line 2016-08-26 15:09:26 +02:00
Guillaume Ayoub
9d776470d2 Render PNG images with a wrong mimetype
See #124.
2016-08-26 14:34:28 +02:00
Guillaume Ayoub
a762d94b12 Use values defined in Images 4 for image-rendering 2016-08-24 17:44:21 +02:00
Guillaume Ayoub
777ca829cc Don't warn when drawing empty SVG files 2016-02-26 15:35:47 +01:00
Guillaume Ayoub
13fde51191 Don't crash with SVG images breaking CairoSVG 2016-02-26 15:29:05 +01:00
Guillaume Ayoub
b9af5666f5 Fix the intrinsic ratio calculation for SVG images 2016-02-26 15:28:43 +01:00
Guillaume Ayoub
d71ef5f4cb Cut too long line 2016-02-26 14:36:22 +01:00
Guillaume Ayoub
f3b4fa2850 Enhance the support of SVG images
This commit adds two features:
- don't render SVG files twice anymore; and
- support SVG images with no intrinsic ratio.
2016-02-26 13:58:47 +01:00
Guillaume Ayoub
71f74935e9 Don't call install_as_pycairo anymore
This was needed when CairoSVG was relying on pycairo instead of
cairocffi, that's not the case anymore since 2013.

It fixes the import problem reported by pep8.
2016-01-15 13:15:02 +01:00
Alex Eftimie
93f497bf11 Replace utf8 with utf-8 for gettext compatibility 2015-11-25 09:38:01 +02:00
Simon Sapin
2666e33a15 Avoid a crash with zero-sized background images. Fix #217. 2014-09-16 20:44:35 +01:00
Simon Sapin
c34221d215 2014. 2014-01-10 14:27:02 +00:00
Simon Sapin
637a4933c2 Add 'image-resolution' from css-images-3.
This is the only way to use high-resolution images in the 'content' property,
where individual images can not be selected to use the 'width' or 'height'
properties.
2013-12-31 15:31:35 +01:00
Florian Mounier
e3d7bad55b Be careful logging.warn is deprecated 2013-08-19 14:38:09 +02:00
Simon Sapin
3313c061ae Fix #84: Mak loading an author stylesheet not fatal. 2013-06-20 22:11:19 +01:00
Simon Sapin
d8014d28ad Image loading: only swallow exception related to fetching or decoding. 2013-06-20 22:06:47 +01:00
Simon Sapin
05e1cb22b2 URL fetching: enforce closing sockets/files with a context manager. 2013-06-20 15:16:47 +01:00
Simon Sapin
9d5cebb5ce URL fetching: use an intermediate function rather than a wrapper 2013-06-20 12:17:03 +01:00
Simon Sapin
e8fac4b840 Fix #99: JPEG image not loading with cairo 1.8.x 2013-06-18 12:48:06 +01:00
Simon Sapin
77f8894ced Add pixel tests for gradients. 2013-04-17 18:02:19 +02:00
Simon Sapin
bf86113961 Python 3.1 compat
3.1’s range() objects do not support slicing.
2013-04-17 13:10:36 +02:00
Simon Sapin
1681891f55 Add radial gradient layout tests. 2013-04-16 16:22:14 +02:00
Simon Sapin
b6f6d348bd Add linear gradient layout tests. 2013-04-16 16:22:14 +02:00
Simon Sapin
50ddcf7015 Add parsing tests for gradients. 2013-04-11 16:06:28 +02:00
Simon Sapin
dd8952adc6 Add radial gradients. 2013-04-11 10:39:47 +02:00
Simon Sapin
3ca71a6bed Gradients (still untested), handle pathological cases. 2013-04-11 10:39:47 +02:00
Simon Sapin
3f79655940 Add untest support for linear gradients. 2013-04-05 12:23:29 +02:00
Simon Sapin
8b78aa41c9 Use css-image-3 algoritms for background image sizing. 2013-04-03 18:15:32 +02:00
Simon Sapin
171438f48e 2013 2013-04-03 16:23:48 +02:00
Simon Sapin
0faaceb44f Have Image objects "render themselves" on a cairo Context. 2013-04-03 16:00:31 +02:00
Simon Sapin
e36006ea21 Introduce Image objects, with intrinsic width/height/ratio as attributes. 2013-04-03 13:34:14 +02:00
Simon Sapin
c854feece9 Fix #21: Check for 'data' URL scheme case-insensitively. 2013-03-28 13:33:28 +01:00