Commit Graph

40 Commits

Author SHA1 Message Date
Lovell Fuller 3ca21ee2e8 Increase minimum glib-2.0 dependency to v2.15 (released March 2012) 2020-03-26 19:13:21 +00:00
John Cupitt 764b196d50 move pdfload on top of source API
and add pdfload_source

see https://github.com/libvips/libvips/issues/1541
2020-03-11 18:15:15 +00:00
John Cupitt 8752a76e66 fix a race in tiled tiffload and pdfload
We weer minimising sources in the ::minimise handler, but this is called
outside the lock that protects _generate. This patch removes minimise in
this case.

See https://github.com/kleisauke/net-vips/issues/53
2020-01-14 18:06:12 +00:00
John Cupitt 1a2a4a41f1 remove dbg code now travis is fixed 2019-11-27 22:20:33 +00:00
John Cupitt 9f6ea7b799 more dbg code to help travis 2019-11-27 20:09:04 +00:00
John Cupitt be7c1404c3 add a note about pdfium minimise 2019-10-07 17:19:12 +01:00
John Cupitt 3f1eb2c7dd test pdfload in te new desc tester
and fix a couple of small issues
2019-10-06 18:27:40 +01:00
John Cupitt e16e4abeda make pdfload header a proper vfunc
_buffer was not inheriting it correctly
2019-09-19 18:09:19 +01:00
John Cupitt 0323b77666 pdfload reopens after minimise if necessary
We were using "minimise" to close pdf input early, but this will break
programs which make several output images from one sequential input
image. For example, loading all pages of a PDF as a toilet-roll image,
then saving pages as a set of PNGs.

This patch adds vfuncs for open and close, and makes _generate reopen
the input if necessary.

We will need similar patches for pdfiumload, gifload, gifnsload,
tiffload etc.

see https://github.com/libvips/libvips/issues/1370#issuecomment-533169856
2019-09-19 17:04:42 +01:00
John Cupitt c1e46c53b5 clarify docs for pdfload
Expand note on @background for pdfload.

See https://github.com/libvips/libvips/issues/1412
2019-08-28 06:47:48 +01:00
John Cupitt 53e0bc6698 pdfload / pdfiumload use minimise to close early
see https://github.com/libvips/libvips/issues/1370#issuecomment-514949292
2019-07-25 11:31:21 +01:00
John Cupitt 675c6361eb revise page-height rules again
Only set `page-height` if `n` is set as an argument. This means you only
get a multi-page image if you specifically ask for it.
2019-05-29 14:18:46 +01:00
John Cupitt bd8a6980f5 more consistent behaviour for multi-page load
Some loaders were setting page-height even when the user was loading a
single page triggering unexpected multi-page behaviour from later
savers.

New rule: only set page-height when loading more than one page.

See https://github.com/libvips/libvips/issues/1318
2019-05-29 10:10:28 +01:00
John Cupitt 29d29533d4 better pdfload page size rounding
We were doing simple round down for page size with @scale param. But
this makes it very sensitive to rounding errors, so do rint() instead.

vips-resize() does rint() on the output size as well for the same
reason.

See https://github.com/libvips/libvips/issues/1297#issuecomment-487682785
2019-04-30 16:08:26 +01:00
John Cupitt 671b3e76f5 set page-height more often in pdfload 2019-01-30 20:58:47 +00:00
John Cupitt e106e1d100 add n/page params to webpload
and renumber all optional load args
2018-11-01 20:43:07 +00:00
John Cupitt 10d1aeb6f2 make pdf load close early
but only in seq mode
2018-08-17 11:14:06 +01:00
John Cupitt fb64d3607a add @background option to pdfload
Add a "background" option to pdfload to help support PDFs with a
transparent background. For example:

	vips copy transparent.pdf[background=0] x.png

see https://github.com/jcupitt/libvips/issues/995
2018-06-08 10:28:00 +01:00
John Cupitt da6f4fd043 add n-pages metadata item
tiff, magick and pdf load now attach an n-pages metadata item recording
the number of pages in the orginal file

see https://github.com/jcupitt/libvips/issues/953
2018-04-26 08:55:31 +01:00
John Cupitt b8ff9c2069 remove progressive pdfload advice
does not apply to pdfium, and hardly to poppler
2018-04-13 10:15:41 +01:00
John Cupitt c0569d25bf final fixups
- add buffer load
- test under valgrind
- code sharing with the poppler pdf loader
2018-04-11 18:53:38 +01:00
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
Alistair Thomas 0506c49444 Update GObject introspection annotations for libvips/foreign directory 2017-09-26 23:39:06 +01:00
John Cupitt 91e52f3d36 oops 2017-06-28 09:32:30 +01:00
John Cupitt 61d5ba7b58 larger strip size for pdfload
We had 128-pixel high strips for pdfload. This kept mem use very low,
but meant many calls to page_render. For a tall page with an image
background, we could take almost an hour to render a single page as the
background was repeatedly repainted.

Change the strip height to 5000. This will render most pages in a single
call, but still allow huge images.

See https://github.com/jcupitt/libvips/issues/681
2017-06-28 09:16:06 +01:00
John Cupitt fc7f9d4941 fix some load nicknames 2017-03-13 10:20:42 +00:00
John Cupitt 8c84e6cc34 add page-height to pdfload 2016-11-23 22:11:26 +00: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
John Cupitt a613841a49 oop various fixes
seems to work now
2016-05-13 09:16:34 +01:00
John Cupitt f18fbe1fa2 add @n option to pdfload
so you can load many pages at once as a tall strip
2016-05-12 14:13:50 +01:00
John Cupitt a4b5608e3b tiny win32 fixes 2016-03-29 10:13:09 +01:00
John Cupitt 95a74cbf28 tiny help polishing 2016-03-25 16:35:28 +00: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 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
John Cupitt 5ca90dc2be final polish 2016-02-08 21:40:44 +00:00
John Cupitt 991cc4f88b rename as pdfload 2016-02-08 20:25:03 +00:00