John Cupitt
5176b4a17e
better header sniffing for small files
...
vips__get_bytes() used to fail if the file was too small for the
allocated buffer, which was a problem for svg, since files can be extremely
small.
This change makes vips__get_bytes() return the number of bytes read, so
the is_a testers can work on files smaller than the max header size.
2018-03-22 12:08:39 +00:00
John Cupitt
5a1ab5968b
move svg_ia_a into the base class
...
feels a bit more logical
2018-03-22 10:43:01 +00:00
Lovell Fuller
63cab9bc62
Add is_a support to SVG file class loader
2018-03-21 16:55:55 +00:00
Alistair Thomas
0506c49444
Update GObject introspection annotations for libvips/foreign directory
2017-09-26 23:39:06 +01:00
John Cupitt
b2f66a3968
add note on svgload improvement
2017-09-17 05:20:48 +01:00
John Cupitt
99053d41cb
Merge pull request #724 from lovell/svg-scale
...
Correct scaling of SVG input without width and height attributes
2017-09-17 05:12:44 +01:00
John Cupitt
6641773719
note change in svgload header
2017-09-09 12:28:27 +01:00
John Cupitt
592710dd6d
limit tile width for svgload
...
librsvg starts to fail if any single tiles has an axis over 32767
pixels. Break up very wide images to fix this.
See:
https://github.com/jcupitt/libvips/issues/732
2017-09-09 12:23:11 +01:00
Lovell Fuller
980095a8cc
Scale SVG without width/height attrs using cairo
2017-09-03 20:11:16 +01:00
John Cupitt
060bdd2cf0
fix svgload resolution again
...
use rsvg_handle_set_dpi() rather than cairo_scale() to avoid int
truncation on dimensions
see https://github.com/jcupitt/libvips/issues/688
2017-07-08 16:03:56 +01:00
John Cupitt
64fe910fc5
fix DPI mixup
...
librsvg defaulted to 90 DPI, but libvips to 72 DPI -- add a correction
factor
thanks Fosk!
see https://github.com/jcupitt/libvips/issues/688
2017-07-08 12:31:36 +01:00
John Cupitt
79c21dfcf8
seems to be done!
2017-01-18 14:39:27 +00:00
John Cupitt
0518e290f6
bump svg header test to first 300 bytes
...
to allow for longer comment lines
2016-10-20 09:31:35 +01:00
Lovell Fuller
de6a415832
Increase SVG buffer check length by 50 bytes
...
Provides support for files exported by Illustrator
2016-10-19 21:40:25 +01:00
John Cupitt
e439c5f78f
add .svg.gz suffix
...
allow .x.y suffixes
2016-08-01 14:57:33 +01:00
John Cupitt
b0e3035590
small cleanups to svgz support
2016-08-01 14:28:35 +01:00
Felix Bünemann
5ab0001ec6
Add configure check for zlib with inflateInit2
...
and replace old unused and poorly named FIND_ZIP. The new code prefers
pkgconfig and only falls back to manual detection if needed.
This also prioritizes detected zlib flags and includes to be preferred
over the ones that are added by pkgconfig for libpng, tifflib etc. which
would otherwise have caused the system default zlib to be used.
2016-06-27 03:03:45 +02:00
Felix Bünemann
14953c19e7
Add support for .svgz files to svgload
2016-06-27 01:54:53 +02:00
John Cupitt
916e5b5589
set filename on file read for more types
...
the new loaders were missing the line to set the output filename, so
`vipsheader fred.pdf` was not displaying the filename correctly
2016-06-01 09:14:01 +01:00
John Cupitt
50468a07a2
clean up foreign
...
various cosmetic changes:
- pngsave_buffer now uses Write, not WriteBuf, same change for
radsave_buffer
- move C wrappers out to class defs from foreign.c
- use g_free() not vips_free() for buffer free from low-level savers
- fix var names in some comments
- various style changes for radiance.c
2016-05-24 10:57:02 +01:00
Felix Bünemann
6418ab2307
Extract shared pdfload/svgload code into cairo.c
2016-05-09 00:16:48 +02:00
John Cupitt
ddd7ab7459
doc fixups
2016-03-25 10:56:59 +00:00
John Cupitt
bd985731eb
unpremultiply svgload / pdfload
...
cairo uses premultipled ARGB, we need to undo this for transparency to
work correctly
2016-02-11 09:06:09 +00:00
John Cupitt
9f2da7d0ee
small fixes
...
use 255 for PDF background
2016-02-10 15:19:00 +00:00
John Cupitt
a037346093
better cache sizing for pdfload and svgload
2016-02-10 09:20:28 +00:00
John Cupitt
77b8eaf653
fix svgload priority
2016-02-09 17:12:44 +00:00
John Cupitt
fc7691b04a
oops overflow
...
thanks lovell
2016-02-09 15:55:22 +00:00
John Cupitt
4a63e961ea
much faster is_a_svg
2016-02-09 14:42:27 +00:00
John Cupitt
3e9c0b4068
oop typo
2016-02-09 14:08:09 +00:00
John Cupitt
56e45545d3
fix load from buffer
2016-02-09 11:58:43 +00:00
John Cupitt
153886d2eb
add svgload
...
load from bubffer is not working though, strange ... it seems to be
generating a 16-biit image?
2016-02-09 11:01:12 +00:00