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