Commit Graph

31 Commits

Author SHA1 Message Date
John Cupitt cdcafbc4c5 add changelog notes
and linewrap for 80 column limit
2022-05-07 12:51:58 +01:00
Kleis Auke Wolthuizen 894ed1cb13
Resize improvements; add `ceil` and `gap` options (#1769)
* Add a round-up option to shrink

* Only leave the final 200% to reduce

* Add gap option to reduce and resize

* Add unit tests

* Incorporate feedback
2022-05-07 12:45:38 +01:00
Kleis Auke Wolthuizen 0337c09700
Cleanup gettext handling (#2695)
Use GLib's i18n support instead of copying and pasting that
logic into its own header. This deprecates the vips/intl.h
header in favour of glib/gi18n.h.
2022-02-27 15:27:28 +00:00
John Cupitt 3b2c77dd35 free shrinkv resources earlier
Free the shrinkv line buffer and struct at the end of eval, not on image
dispose. This helps keep mem use down in some long-running operations.

Thank you homm, see https://github.com/libvips/pyvips/issues/147
2020-01-02 15:32:43 +00:00
John Cupitt e1baf66f19 "squash" to tiffsave now does lab as well
The "squash" option to tiffsave now also squashes 32-bit 3-band float
CIELAB images down to 8 bits.

See https://github.com/libvips/libvips/issues/1499
2019-12-18 17:29:34 +00:00
John Cupitt 6ba34e479e better shrinkv for int32 types
use double as the sum type to prevent int overflow
2019-08-06 16:55:10 +01:00
John Cupitt 2841504fa0 fix a possible int overflow 2019-08-03 21:14:19 +01:00
John Cupitt 3c8a9815ba fix int overflow in shrinkv 2019-08-03 03:31:54 +01:00
John Cupitt 7f08e8fd28 remove stray flag 2019-07-27 16:13:54 +01:00
John Cupitt 01a82646a1 experiment with minimise in insert
try minimising sub after we've passed it
2019-07-27 13:40:18 +01:00
John Cupitt 4f2f4b4577 add gif, heif, rad, webp early close 2019-07-21 12:29:25 +01:00
John Cupitt 2c654060f9 experiment with a different early-close strategy
We close loaders early in order to save file handles, and on Windows to
make sure that files can be deleted as soon as possible.

Currently loaders do this by watching the Y coordinate of requests and
freeing the fd when the final line of the file is fetched. This is messy
and does not always work, since there are cases when the final line is
not fetched.

Instead, this patch gets loaders to listen for "minimise" on their
output and close on that. This signal is emitted on all upstream images
whenever a threadpool finishes a scan of an image and is usually used to
trim caches after computation.

See https://github.com/libvips/libvips/issues/1370
2019-07-20 16:31:30 +01:00
John Cupitt 7f47acab56 tiny improvement 2019-07-10 17:43:17 +01:00
John Cupitt 5e2d66d14b better early shutdown behaviour in shrinkv
read the tail of the input to force early shutdown in seq readers

does reducev need something similar?

see https://github.com/kleisauke/net-vips/issues/12
2019-07-09 16:58:30 +01:00
Alistair Thomas c24d36fc79 Update GObject introspection annotations for libvips/resample directory 2017-09-30 17:26:55 +01:00
John Cupitt 3ca206815c put a seq on reducev too 2017-03-07 11:27:36 +00:00
John Cupitt daaea28a5e shrinkv seq cache should be another sequential 2017-03-06 16:25:19 +00:00
John Cupitt e4ab251fd1 small cleanups
make embed less chatty with --vips-cache-trace

shrink can use linecache now

found a fail case on the work machine
2017-03-06 14:51:45 +00:00
John Cupitt 362c7efdfc argh reapply seq removal 2017-03-06 11:55:38 +00:00
John Cupitt dd5a108854 fix up new seq mode stuff
seems to work
2017-03-05 21:59:53 +00:00
John Cupitt 55840cf131 try setting a seq meta
and only caching in shrinkv if we see the tag
2017-03-05 21:59:01 +00:00
John Cupitt e6b20cbd0f Revert "remove stalling"
This reverts commit 959f412380.
2017-02-27 10:26:32 +00:00
John Cupitt 959f412380 remove stalling 2017-02-21 15:03:15 +00:00
John Cupitt b140c18a37 various tweaks to calm coverity
passes cleanly now
2017-01-20 08:55:13 +00:00
John Cupitt 271d8656e9 use round() rather than rint() where appropriate
rint() rounds to nearest even, rather than nearest ... in some cases,
like geometry transforms, we want strict nearest
2016-08-20 12:59:41 +01:00
John Cupitt 1f403a4add first attempt
seems to all work, test it a bit more

see https://github.com/jcupitt/libvips/issues/491
2016-08-15 15:45:26 +01:00
John Cupitt f3326c8126 better vips_resize() for cubic/linear/nearest
vips_resize() used to do most of a downsize with vips_shrink() and the
final 200 - 300% with vips_reduce(). This was correct for lanczos2/3,
but not right for linear/cubic, which need more shrink and less
reduce to avoid aliasing.

This patch makes vips_resize() leave the final 100 - 200% to
vips_reduce() for linear/cubic, and leave everything to reduce for
nearest.
2016-06-16 09:46:02 +01:00
John Cupitt e8b5cb6c23 add VIPS_COUNT_PIXELS, overcomputation tracking
added VIPS_COUNT_PIXELS(), use like this:

	static int vips_shrinkh_gen( VipsRegion *or, ... )
	{
        	VIPS_COUNT_PIXELS( or, "vips_shrinkh_gen" );
	}

and on image close, if more than 100% of the pixels have been
calculated, you get a warning

only if you enable debugging, since this hurts perf slightly
2016-03-22 12:26:45 +00:00
John Cupitt 07a1903390 use g_assert_not_reached()
we were using g_assert(0) ... g_assert_not_reached() makes the
intention clearer
2016-01-24 13:21:53 +00:00
John Cupitt 582a7f1810 shrink2 now done
big mem saving, still a bit slower though
2015-10-31 10:43:08 +00:00
John Cupitt da8f236f95 try a split shrink
not quite done yet
2015-10-30 18:15:14 +00:00