Commit Graph

1322 Commits

Author SHA1 Message Date
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
John Cupitt
72ea91fecc fix nohalo, vsqbs interpolators
we were getting occasional memory access problems in nohalo and vsqbs
interpolators ... the previous fix was not enough

version bump
2016-03-24 16:06:31 +00: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
46a18118c6 works! 2016-03-15 16:46:18 +00:00
John Cupitt
dc7902b12f Merge branch 'master' into add-lanczos3 2016-03-13 11:23:03 +00:00
John Cupitt
6368ab0649 add switches to disable rad, analyze and ppm
vips has built-in support for rad, analyze and ppm ... add configure
switches to disable these readers

useful to reduce the attack surface in some applications
2016-03-12 16:48:27 +00:00
John Cupitt
42224b6b0e Merge branch '8.2' 2016-03-12 15:12:56 +00:00
John Cupitt
abe4e70d02 make radload slightly more robust
stops some valgrind warnings
2016-03-12 15:10:52 +00:00
John Cupitt
4974a1ed9c better rounding for vips_resize()
we were getting off by one size errors
2016-03-10 19:53:05 +00:00
John Cupitt
9209fb25c5 update notes 2016-03-10 17:40:19 +00:00
John Cupitt
9201248623 Merge branch '8.2' 2016-03-06 18:05:12 +00:00
John Cupitt
acf5f5169a fix hist_entropy
there was a copy-paste error in the call to vips_log(), thanks Lovell

see https://github.com/lovell/sharp/issues/295
2016-03-06 18:02:59 +00:00
John Cupitt
2ea5c5f7e5 make python bandrank() work like bandjoin()
we had a custom wrapper for bandjoin(), but bandrank(), a function with
an almost identical interface, did not ... this was confusing

bandrank() now has a custom wrapper too ... this breaks API
unfortunately, but hopefully very few people were using this thing and
it's better to make this change as soon as possible
2016-03-01 12:12:51 +00:00
John Cupitt
25c3c49d1c better handling of cast+shift for non-int formats
before, im.cast(uchar, shift = true) where im was float and tagged as
rgb16 would not shift the image, since it's unclear how much to shift a float
type by

now we do two casts: first, we guess the numeric range from the
interpretation, so rgb16 would be ushort, so we cast float->ushort;
second, we cast to the target type and do the shift on the way

see https://github.com/jcupitt/libvips/issues/397

thanks apacheark
2016-03-01 11:31:54 +00:00
John Cupitt
19a838470b add webp shrink-on-load
and vipsthumbnail knows about it too

see https://github.com/jcupitt/libvips/issues/398
2016-02-28 14:36:21 +00:00
John Cupitt
e582f13d13 tiny polish to hist_find
slightly faster again
2016-02-28 12:08:06 +00:00
John Cupitt
b197773095 oop, overflow in sharpen
plus another tweak of the defaults
2016-02-28 11:24:35 +00:00
John Cupitt
ee1874c5ca much better handling of arrayimage cli args
we were not setting the access hint on arrayimage args, so

arrayjoin "$(echo *.jpg)" x.tif[bigtiff] --across 10

would open all the jpg images to memory, usually, in random mode

now arrayimage args see the operation's access hint (seq in this case),
for much better behaviour

also, we allow any whitespace as an arg separator in arrayimage from
string
2016-02-27 20:37:20 +00:00
John Cupitt
609e639528 Merge branch '8.2' 2016-02-26 12:44:54 +00:00
John Cupitt
5a60dd26f9 fix parsing of filenames containing brackets
oops, missed part of a regexp in parse_token, see:

https://github.com/jcupitt/libvips/issues/395

thanks shilpi230
2016-02-26 12:41:48 +00:00
John Cupitt
c1f1a7c1b3 improve sharpen for screen work
it was a bit granular (since it was designed for offset work), make sharpen
easier to adjust for smaller effects

- new 'sigma' parameter
- greater parameter range
- more self-tests
2016-02-25 11:16:24 +00:00
John Cupitt
01238a0fd5 more progressive jpg changes
- Remove the nocache stuff for prog jpg images. There was no saving in
  practice, since operations downstream could be cached.

  nocache is for objects that can change, not for memory saving

- Call _destroy on the decompress object much earlier, it frees a huge
  amount of memoey for prog jpg images.
2016-02-21 10:57:36 +00:00
John Cupitt
6f94cb5ed4 don't cache progressive jpg images
progressive jpg images need loads of memory, we shouldn't cache them by
default ... our called can hold a ref if they want to keep the image
around

see https://github.com/jcupitt/libvips/issues/387
2016-02-18 19:00:19 +00:00
John Cupitt
de59ff0e5a Merge branch 'master' into add-magickload-page 2016-02-18 11:28:09 +00:00
John Cupitt
ef6d8f5979 make test for matlab files more specific
Previously vips just called Mat_Open() to test if a file was a Matlab
save file, but this is rather unreliable. For example, some JPEG files
can crash libmatio, and it can incorrectly think that at least some JP2
files are Matlab save files.

Instead, look for "MATLAB 5.0" at the start of the file. This is really too
specific, the first 116 bytes of a Matlab save file are freeform text,
but in practice all Matlab writers use the first few bytes to record the
file type.

See https://github.com/jcupitt/libvips/issues/385
2016-02-16 09:53:04 +00:00
John Cupitt
8e667fbb3e still not quite there
works, but is no faster, how odd

john@kiwi:~/pics$ time vips magickload nipguide.pdf[40] x.tif
real	0m0.244s
user	0m0.212s
sys	0m0.040s

$ time vips magickload nipguide.pdf x.tif --page 40
real	0m7.035s
user	0m6.900s
sys	0m0.152s

both give same result
2016-02-15 08:53:23 +00:00
John Cupitt
9262d672b7 almost done
a valgrind failure still
2016-02-12 10:53:04 +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
625e0fbd9e vipsthumbnail knows about pdfload
woo, fast!
2016-02-09 09:26:54 +00:00
John Cupitt
991cc4f88b rename as pdfload 2016-02-08 20:25:03 +00:00
John Cupitt
69c2fe00f7 add C API and docs for popplerload 2016-02-08 10:05:37 +00:00
John Cupitt
8da4e706dd start adding poppler support 2016-02-07 23:33:43 +00:00
John Cupitt
41b41effde Merge branch 'add-reduce' 2016-02-07 17:46:46 +00:00
John Cupitt
8cffd136e9 finish reduce
and fix up bicubic a bit, it works better on int32 images now
2016-02-07 17:41:39 +00:00
John Cupitt
67f3ecfd8d wire up to resize / similarity
still need tests
2016-01-29 15:23:00 +00:00
John Cupitt
e4b31dde38 fix labq sparc read
byteswap was swapping coded images, or trying to
2016-01-27 12:44:36 +00:00
John Cupitt
db20d70495 fix some more compiler warnings
and a bit of formatting
2016-01-26 15:10:46 +00:00
John Cupitt
4d18300560 add VIPS_FABS/MAX/MIN/CLIP
macros which use the gcc __builtin_fabs() etc. functions when they can
2016-01-26 12:26:21 +00:00
John Cupitt
73bcc8b5d3 improve the using-C docs
add some stuff on giving options to operations

see https://github.com/jcupitt/libvips/issues/373
2016-01-25 09:35:06 +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
a7d889df06 use builtin floor / ceil
get rid of FAST_PSEUDO_FLOOR, add VIPS_FLOOR and VIPS_CEIL, use them
everywhere

see https://github.com/jcupitt/libvips/pull/372
2016-01-23 09:50:57 +00:00
John Cupitt
94db738773 fix double free on tiff write
if you attached a profile to a tiff from a file during write, you'd get
a double-free

see https://github.com/jcupitt/libvips/issues/371
2016-01-22 17:43:42 +00:00
John Cupitt
c7eb88b87f fix subsample at the command-line
it had the SEQ flag set, causing confusion with vips_sequential() when
it skipped scanlines on startup

see https://github.com/jcupitt/libvips/issues/370
2016-01-22 14:37:42 +00:00
John Cupitt
2e5880b69c speed up for vips_shrinkh()
remove the sum buffer, we can just use a local, about 5% faster

see https://github.com/jcupitt/libvips/pull/369
2016-01-22 09:15:38 +00:00
John Cupitt
af8b43b16d fix to make check in non-C locales
"make check" uses bc, which needs '.' as a decimal sep.

https://github.com/jcupitt/libvips/issues/367
2016-01-17 09:29:25 +00:00
John Cupitt
4512400a3c better rounding in new bilinear interp
was off by 0.5
2016-01-14 13:13:08 +00:00
John Cupitt
6ca9a907b8 reorder load tests
and a slight memory saving on ifthenelse
2016-01-13 20:32:23 +00:00
John Cupitt
52384606dd bump version for new C++ patch 2016-01-12 17:12:46 +00:00
John Cupitt
50db131865 VImage::get_typeof() returns GType
it was int, causing some compiler warnings on some platforms.

see https://github.com/jcupitt/libvips/issues/362
2016-01-09 20:27:14 +00:00
John Cupitt
66373e9b41 remove exception specs from vips8 C++ interface
We had exception specs on the C++ interface, but C++11 does not support
them and some compilers have never honoured them. Remove all specs.
Thanks Lovell.

See https://github.com/jcupitt/libvips/issues/362
2016-01-09 14:52:05 +00:00
John Cupitt
9419e07a6b remove a lock from VImage.cc
it wasn't really needed, and windows will barf with pointers across
DLLs
2016-01-08 13:40:58 +00:00
John Cupitt
b85231baba small doc improvements 2016-01-07 11:16:12 +00:00
John Cupitt
e27aa4488a clearer changelog entry 2016-01-04 17:24:00 +00:00
John Cupitt
e81900b187 bandjoin is just an instance function
we had both a class member bandjoin, and an instance member

Vips.Image.bandjoin([i1, i2, i3..])
i1.ibandjoin([i2, i3..])

this was confusing and annoying ... get rid of the class one and just
use bandjoin everywhere, so this is now the way to do it:

i1.bandjoin([i2, i3..])
2016-01-04 14:18:10 +00:00
John Cupitt
e6cbdbb516 add a stub for compat
see https://github.com/jcupitt/libvips/issues/361
2016-01-01 10:58:53 +00:00
John Cupitt
8302e2ffcd notes on dzsave change
see https://github.com/jcupitt/libvips/pull/359
2015-12-23 09:16:58 +00:00
John Cupitt
73436ddfc2 add @properties flag to tiffsave
writes all vips metadata to imagedescription tag
2015-12-21 14:43:59 +00:00
John Cupitt
0deb640bc4 load and save TIFFTAG_IMAGEDESCRIPTION
this often has useful metadata in, for example the OME spec has all the
metadata in there as an XML document

see https://github.com/jcupitt/libvips/issues/358
2015-12-21 13:53:33 +00:00
John Cupitt
efed79f298 Merge branch 'new-bilinear' 2015-12-17 13:43:51 +00:00
John Cupitt
fb084ef6a6 working 2015-12-17 13:43:34 +00:00
John Cupitt
c74f7457a6 Merge branch 'master' of github.com:jcupitt/libvips 2015-12-17 12:58:04 +00:00
John Cupitt
42f5403cfa notes 2015-12-15 10:49:02 +00:00
John Cupitt
af6e00e10f Merge branch 'master' of github.com:jcupitt/libvips 2015-12-15 10:45:23 +00:00
John Cupitt
70cf12d034 notes 2015-12-15 10:44:30 +00:00
John Cupitt
5916e25c31 rename python bandjoin as ibandjoin
oh argh class and instance methods are in the same namespace, so we have
to rename the instance one as ibandjoin

also, start adding a test for arrayjoin
2015-12-12 12:29:20 +00:00
John Cupitt
6e9834e623 add vips_arrayjoin() 2015-12-11 15:14:08 +00:00
John Cupitt
2409767679 add vips_image_new_from_memory_copy()
takes a copy of a memory area when making an image ... this helps bindings
for languages which don't have much control over memory

see https://github.com/jcupitt/libvips/issues/346
2015-11-25 17:05:59 +00:00
John Cupitt
6573af3c2a always strip dzsave tile metadata
dzsave now uses :strip => true for all tiles. There's no point adding
all the metadata to every tile, so hopefully this won't break anything.

Thanks Benjamin, see: https://github.com/jcupitt/libvips/issues/349
2015-11-25 13:29:23 +00:00
John Cupitt
e19f9ea0b3 working!
doesn't seem to slow us down significantly ... before:

$ time vips dzsave CMU-1.svs x --layout google --background "243 243 243 255"
real	1m1.940s
user	2m15.004s
sys	0m37.092s

after:

$ time vips dzsave CMU-1.svs x --layout google --background "243 243 243 255"
strip_work: skipping blank tile 176 x 67
strip_work: skipping blank tile 21 x 112
real	1m3.503s
user	2m16.012s
sys	0m40.328s
2015-11-24 17:08:56 +00:00
John Cupitt
2620f3b8c9 allow non-square vips_resize()
in a very crude way
2015-11-19 17:09:18 +00:00
John Cupitt
8506ff13a6 try to improve vips_resize() quality
small improvements to vips_resize() quality:

* turn down the anti-alias filter a little so we don't smudge out texture
* don't do the final sharpening pass if we skipped the anti-alias filter
* fix a >/>= mixup which meant we didn't sharpen for small resizes
2015-11-19 15:22:23 +00:00
John Cupitt
743b21e83e fix off by 1 error 2015-11-19 13:25:52 +00:00
John Cupitt
bfbe254ece sync 2015-11-17 10:13:48 +00:00
John Cupitt
8e6ed3ef30 compiles 2015-11-16 14:58:51 +00:00
John Cupitt
3b32200cc1 sizealike() and friends elide completely
sizealike() / formatalike() and bandsalike() used to just vips_copy() if
the image didn't need any changes ... this was fast, but left a
vips_copy_gen() in the pipeline, wasting a lot of space on the C stack
during recursion.

They now vanish completely if the image is already in the right format.
Since we call them before most image processing operations, and
often all three of them, this saves a lot of C stack, more than x2 even
in simple cases.

There might also be a measureable CPU saving if the operations are very
simple (eg. insert).

See:

http://stackoverflow.com/questions/33658795/difficulty-with-handling-very-large-image-using-vips
2015-11-13 14:48:02 +00:00
John Cupitt
d94a2807c9 smarter cache sizing for vips_resize
see comment in code, should now account for max delay possible
2015-11-11 10:23:50 +00:00
John Cupitt
66fe338d36 better alpha handling for tiff save
the tiff saver was writing all five-band images as CMYKA, even if they
were tagged as srgb ... it now follows the interpretation tag and will
write many alpha channels instead

see https://github.com/jcupitt/libvips/issues/348

thanks sadaqatullahn
2015-11-11 08:55:42 +00:00
John Cupitt
9cb2674a77 now works woo
python interface plus test and benchmark to go

update c++ too I guess

oh docs as well sigh
2015-11-07 18:47:02 +00:00
John Cupitt
b853012787 add memory.h to Python API
this makes the memory high water visible to Python, handy for testing
2015-11-04 10:09:06 +00:00
John Cupitt
11ce13d43d enable new shrink code
2x faster, much lower memuse
2015-10-31 12:15:48 +00:00
John Cupitt
2b46b7e889 many more const decls
ruby gobject-introspection is quite fussy about needing a lot of const
declarations ... these changes help vips_image_matrix_from_array()
appear in Ruby
2015-10-23 11:45:11 +01:00
John Cupitt
64d081e726 return default value for unset props
we used to issue a warning and return early, but this can leave garbage
in the *value pointer, I think

ruby gobject-introspection will walk object props during GC and can see
state inbetween init and build when not all objects have been given a
value ... we don't want these warnings
2015-10-16 14:50:44 +01:00
John Cupitt
faf7b70e2e Merge branch '8.1'
Conflicts:
	ChangeLog
2015-10-14 13:04:36 +01:00
John Cupitt
4b25ce2cf2 note pathname parse fix 2015-10-14 13:00:41 +01:00