Commit Graph

1305 Commits

Author SHA1 Message Date
John Cupitt 65105a9442 upsize with something other than nearest
vips_resize() uses to just use nearest when upsizing, following standard
practice in repro. This is often unfortunate for image processing, where
small nearest upsizes will produce obvious aliasing.

It now picks a VipsInterpolate which corresponds (roughly) to the
selected VipsKernel and uses that with affine for any upsizing.
2016-06-22 10:33:08 +01:00
John Cupitt 11b136b2df pyvips8 can create new metadata
previously it tried to lookup the type of the field in set(), now if
OK if there's no field there already
2016-06-17 11:27:13 +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 a5bef08d4a better reducev multiplication
more accurate, no slower

add more tests too
2016-06-15 13:56:19 +01:00
John Cupitt eb7768ff61 Merge branch 'master' into add-assignment-overloads 2016-06-11 20:15:42 +01:00
John Cupitt 28efdf1695 working! 2016-06-11 17:36:06 +01:00
John Cupitt 8667dd0d18 VImage::ifthenelse() fix
the prototype was missing =0 on options for scalar constant forms
2016-06-10 17:34:41 +01:00
John Cupitt ad56c57830 add implementation for VImage::write()
oops, it was missing

also, change the return type from void to VImage. This makes chaining
possible, eg.:

   VImage memory = im.write( Viameg::new_memory() );
2016-06-10 14:22:08 +01:00
John Cupitt 1909b31bd6 vips_image_write() only refs input when it has to
when you write to a non-partial image, you create a sink ... so
vips_image_write() only needs to ref the input when writing to partials

this change makes it much easier to (for example) combine many images in
bounded space, see for example:

https://gist.github.com/jcupitt/c516325ebef7601b5da610af5619c9b2
2016-06-10 13:58:01 +01:00
John Cupitt 3ed174e9cb Merge branch 'master' into free-non-worker-buffers 2016-06-09 18:36:41 +01:00
John Cupitt 8cd3d18caf remove is_zip from dzsave
we can use GSF_IS_OUTFILE_ZIP() instead
2016-06-08 14:46:45 +01:00
John Cupitt b90145ca31 free pixel buffers on image close
We were freeing pixel buffers on thread exit. This was convenient, but
meant that main thread buffers were not freed until program exit. As a
result, long-running programs which created main thread buffers would
slowly fill the operation cache with useless junk, forcing everything else out.

This change also frees pixel buffers on image close. This makes the
cache work much better in long-running programs, and can substantially
reduce memory use.

See https://github.com/jcupitt/libvips/issues/466
2016-06-06 13:50:25 +01:00
John Cupitt 15878bffca Revert "free main-thread pixel buffers"
This reverts commit 2a77301033.
2016-06-06 06:38:18 +01:00
John Cupitt 2a77301033 free main-thread pixel buffers
threads keep pixel buffers in thread-private storage, and free these
buffers on thread exit ... this means buffers created by the main thread will
only be freed on program exit!

if your program creates any main-thread buffers, these buffers will
eventually fill the operation cache and force everything else out,
making the cache useless

this patch explicitly frees main-thread pixel buffers on image close
2016-06-05 16:59:07 +01:00
John Cupitt 0faf5395b2 conversion to grey16 could lock
a typo could cause infinite recursion during conversion
2016-06-03 16:24:21 +01:00
John Cupitt c5a4afbe40 support --strip for tiffsave
stops metadata save
2016-06-02 13:14:15 +01:00
John Cupitt 7a91eaa583 tiff save converts for jpg in jpg mode
when jpg compression is on, tiffsave now converts the input image for
jpg save ... previously, it would try to send a tiff-formatted image
(eg. perhaps with an alpha channel, or float data), which would fail

see https://github.com/jcupitt/libvips/issues/449
2016-05-31 22:04:07 +01:00
John Cupitt f0521d4b5d all done!
a few more tests though
2016-05-27 16:53:25 +01:00
John Cupitt 0c28fc71d6 fix radsave
oop, suffix was being set ono the base class
2016-05-24 07:55:30 +01:00
John Cupitt dbbd2850a1 better max_alpha default
it used to default to 255, now it sniff the interpretation and defaults to
65535 for RGB16 and GREY16

see https://github.com/jcupitt/libvips/issues/449
2016-05-23 12:18:39 +01:00
John Cupitt 91aa288a44 break up acinclude.m4
it's now in a more maintainable set of .m4 files in m4-safe
2016-05-18 10:41:05 +01:00
John Cupitt 2b71756352 Merge branch '8.3' 2016-05-18 09:30:22 +01:00
John Cupitt 7ec63c4451 more vips image read fixing
thanks AFL!
2016-05-18 09:00:30 +01:00
John Cupitt 6a445ea9c8 more vips image read fixing
thanks AFL!
2016-05-17 21:58:52 +01:00
John Cupitt 54d8e4808f restore bandfmt after unpremultiply in thumbnail
vips_unpremultiply() always outputs float. If you save the output of
vipsthumbnail to a format that supports float files, like tiff, it won't
ever get cast back to the source format.

Example:

	$ vipsheader Opera-icon-high-res.png
	Opera-icon-high-res.png: 3056x3325 uchar, 4 bands, srgb, pngload
	$ vipsthumbnail Opera-icon-high-res.png -o x.tif
	$ vipsheader x.tif
	x.tif: 117x128 float, 4 bands, scrgb, tiffload

This change makes it note and restore BandFmt aropund pre/unpremultiply.

See https://github.com/jcupitt/libvips/issues/447
2016-05-16 13:18:59 +01:00
John Cupitt db11d3b973 allow nested [] in CLI args
this now works:

	vips copy x y.dz[suffix=.jpg[Q=90]]
2016-05-16 11:09:47 +01:00
John Cupitt 70abf4efde merge pdfload range to master 2016-05-15 10:02:46 +01:00
John Cupitt ffc5279d2f Merge branch 'master' into loadpdf-range 2016-05-15 10:01:27 +01:00
John Cupitt 7f02e843dc add ack for dzsave tile skip
see https://github.com/jcupitt/libvips/issues/352
2016-05-15 09:53:37 +01:00
John Cupitt 46f2776d22 fix up changelog order 2016-05-15 09:50:40 +01:00
John Cupitt 72b67d0ec2 Merge branch 'master' into no-blank-tiles 2016-05-15 09:48:21 +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 143593d6a6 comment reformat 2016-05-09 11:07:48 +01:00
John Cupitt 38fe936eee Merge remote-tracking branch 'origin/8.3' 2016-05-08 11:09:28 +01:00
John Cupitt f7a6a02ee8 fix giflib4 detection
and a problem in giflib4 error handling
2016-05-08 11:02:21 +01:00
John Cupitt 48ef215479 tiny fixups for the webp commit
just small formatting changes, plus an unneeded var

see

	https://github.com/jcupitt/libvips/pull/430
2016-05-02 09:55:16 +01:00
John Cupitt 02821ae9e3 expose @kernel setting for vips_resize()
a new optional arg lets you pick the downsizing kernel
2016-05-01 12:33:49 +01:00
John Cupitt c2d1de9a26 allow mixed zoom and shrink in resize
vips_resize() now allows >1 on one axis, <1 on the other ... previously,
although you could have non-square ratios, you couldn't mix zoom and
shrink
2016-05-01 12:03:13 +01:00
John Cupitt 5e933fe8e9 Merge branch 'master' into no-blank-tiles 2016-04-25 09:54:01 +01:00
John Cupitt d11a7960b7 add support for giflib5
gifload.c now works with giflib5, and well as giflib4 ... forced by
ubuntu's switch to giflib5 in 16.04

see https://github.com/jcupitt/libvips/issues/407
2016-04-25 09:29:25 +01:00
John Cupitt 699ade0877 Merge branch 'master' into no-blank-tiles 2016-04-24 09:59:04 +01:00
John Cupitt 23eaf93867 fix build with graphicsmagick
GM is still using the old page interface of subimage/subrange, IM has
deprecated that in favour of scene/number_scenes

we were accidentally just supporting the new IM system ... this change
adds support for GM as well, plus a configure test to pick one

see https://github.com/jcupitt/libvips/issues/423
2016-04-18 15:21:11 +01:00
John Cupitt f0271f050d note oo stuff 2016-04-18 12:36:55 +01:00
John Cupitt 1e44ab5d39 version bump for 8.3.1 2016-04-15 08:42:36 +01:00
John Cupitt 2c646a02e4 better jpeg autorot
jpeg write is more careful about removing exif tags that have been
removed from the image metadata

it failed previously if there were multiple Orientation tags
2016-04-13 08:39:29 +01:00
John Cupitt f58190bccd tag non-int rgb tiff as scrgb
Photoshop uses 0 - 1 and no gamma for float RGB, so we tag float /
complex RGB tiffs as scRGB

thanks Murat
2016-04-11 12:37:48 +01:00
John Cupitt f3835ef0bf webpsave_buffer no longer ignores @lossless
the @lossless arg to webpsave buffer was never wired up to anything,
thanks aaron42net.

see

https://github.com/jcupitt/libvips/issues/410
2016-03-31 21:48:40 +01:00
John Cupitt 618af96723 vips_system() out-format can take options
you can now put options like [scale=2] at the end of out_format ...
these are stripped before running the command, but use to load the
output image back into libvips again
2016-03-28 10:50:39 +01:00
John Cupitt ddd7ab7459 doc fixups 2016-03-25 10:56:59 +00:00
John Cupitt ec5cdf4fff Merge branch '8.2' 2016-03-24 16:09:44 +00:00