Commit Graph

1630 Commits

Author SHA1 Message Date
John Cupitt b085908558 remove vips7 stuff from API
You must now include vips7 support explicitly with

	#include <vips/vips7compat.h>

in your code just after including `vips.h`.

The old vips7 names, such as `Rect`, were starting to cause problems
with other packages like opencv.
2018-05-16 15:08:21 +01:00
John Cupitt fd7b04fb9d Merge branch '8.6' 2018-05-14 18:10:13 +01:00
John Cupitt 5b132ccbdc note new config test in changelog 2018-05-14 17:19:06 +01:00
John Cupitt e496df598b working! 2018-05-01 15:50:48 +01:00
John Cupitt 4d683559aa add a fontfile option to text
use @fontfile to give a font to load ... note that this just loads the
font, you'll need to set it with @font as well

see https://github.com/jcupitt/libvips/issues/950
2018-04-26 21:03:40 +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 4f22e8d1dc add jpeg-chroma-subsample to jpegload
The jpeg loader now sets the field jpeg-chroma-subsample to record
chroma subsample.

See https://github.com/jcupitt/libvips/issues/954
2018-04-25 16:04:20 +01:00
John Cupitt c410dc2db8 add format option to magickload
Some magick coders (eg. ICO) don't sniff the filetype from the data, so
when you try to load from a string, imagemagick is unable to pick the
right decode path.

Add a @format option so callers can hint the filetype.

see https://github.com/jcupitt/pyvips/issues/39
2018-04-24 15:06:52 +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 5b55dd8ed4 Merge branch '8.6' 2018-04-11 09:38:59 +01:00
John Cupitt d1dd41a21f strict round down on jpeg shrink
libjpeg rounds up on shrink-on-load. In some cases this can leave a dark
line along the right and bottom edge, since it only contains (for
example) 1/4 of a pixel of data.

This change adds a crop after jpeg load so that only complete pixels are
output.

See https://github.com/lovell/sharp/issues/1185
2018-04-10 15:18:18 +01:00
John Cupitt 15abbbe986 set "interlaced" for jpg and png
set "interlaced" for interlaced png and jpg images
2018-04-09 17:14:38 +01:00
John Cupitt 06802e4110 use O_TMPFILE, if available
If O_TNMPFILE is available, use it. This is a linux extension that
creates an unlinked file, so it'll be closed by the system when the last
associated fd is closed.

see https://github.com/jcupitt/libvips/pull/930
2018-04-09 13:27:57 +01:00
John Cupitt f3842dcc4b update cpp example
thanks fangqiao

see https://github.com/jcupitt/libvips/issues/932
2018-04-08 11:44:15 +01:00
John Cupitt 5f3bcd88ae Merge branch '8.6' 2018-04-04 17:11:16 +01:00
John Cupitt 632bce3c78 reduce stack use for radsave
fixes a crash on very low stack libcs like musl
2018-04-04 16:25:35 +01:00
John Cupitt aebb8af803 create funcs always make MULTIBAND
Before, they could make B_W for one-band output. This caused problems
with (for example) two black image bandjoined: the second band then
looked like an alpha to hasalpha() and enabled premultiply/unpremultiply
for operations like affine.

Now, it's always MULTIBAND. This is the generic multiband image type, so
you don't get any unexpected alpha handling.
2018-04-04 09:22:57 +01:00
John Cupitt 0dd6b095aa more conservative hasalpha
The result of hasalpha is used to turn on things like
premultiplication, so we should be rather conservative
about when we signal this. We don't want to premultiply
things that should not be premultiplied.

Check Type as well as bands.

See: https://github.com/jcupitt/libvips/issues/918
2018-04-03 14:36:43 +01:00
John Cupitt e686614f2c drop incompatible profiles from save
libpng has started throwing hard errors if the profile does not match
the image -- this can happen all the time with perofiles inherited from
images that have been processed.

Test profiles before save and drop them (with a warning) if they are
incompatible with the image.
2018-04-01 10:32:48 +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
John Cupitt 5a1ab5968b move svg_ia_a into the base class
feels a bit more logical
2018-03-22 10:43:01 +00:00
John Cupitt 754a1e5419 Merge branch 'master' into add-canny 2018-03-14 14:18:39 +00:00
John Cupitt 206f158a77 Merge branch '8.6' 2018-03-12 18:12:56 +00:00
John Cupitt 878c77a035 better handling of some fonts
fonts with very large overlapping edges copuld clip in `text`, see
https://stackoverflow.com/a/49169747/894763
2018-03-12 18:11:25 +00:00
John Cupitt 08dcf29b10 add vips_rotate()
vips_similarity() was a little hatrd to discover, so add vips_rotate()
as a more obvious name for it
2018-03-10 18:45:39 +00:00
John Cupitt 5834779ac6 Merge branch 'master' into add-canny 2018-03-10 15:13:49 +00:00
John Cupitt 0a05dd4304 Merge branch '8.6' 2018-03-09 16:37:10 +00:00
John Cupitt 29e05dabaf icc_import attaches the input profile if used
icc_import can take a fallback input profile in case the embedded one is
broken or missing. If we use the fallback profile, this change attaches
it to the output image.

This means that icc_import will always output an image with the icc
profile that was used to import it. This helps to make the behaviour of
`thumbnail` more consistent.

See https://github.com/jcupitt/libvips/issues/152
2018-03-08 13:11:54 +00:00
John Cupitt 6e0e31a534 Merge branch '8.6' into add-canny 2018-03-05 15:21:30 +00:00
John Cupitt 6fae79b60d Merge branch '8.6' 2018-03-05 15:09:08 +00:00
John Cupitt 20d840e6da fix a crash with delayed load
If a delayed load failed, it could leave the pipeline only half-set up.
Sebsequent threads could then segv.

Set a load-has-failed flag and test before generate.

See https://github.com/jcupitt/libvips/issues/893
2018-03-05 14:42:09 +00:00
John Cupitt 7f5b0b94c3 Merge branch '8.6' into add-canny 2018-03-04 18:45:59 +00:00
John Cupitt 881a10380e Merge branch '8.6' 2018-03-04 18:45:51 +00:00
John Cupitt eefb2dad98 improve rounding in convi intize
We were rounding up with ceil() when intize-ing convolution masks.
However, the vector path has a true range of (1.0, -1.0], so a mask with
1.0 as the max (for example) was actually triggering the overflow detector
and falling back to the C path.

Round up with ceil(x + 1) instead, so 1.0 (for example) will be mapped
to 0.5 and won't overflow.
2018-03-04 18:30:25 +00:00
John Cupitt bca2418d9a Merge branch 'master' into add-canny 2018-03-04 15:31:19 +00:00
John Cupitt e7a5a8af4a Merge branch '8.6' 2018-03-04 15:31:08 +00:00
John Cupitt 6cff74b602 vips_image_write() could crash if called twice
two writes in a row could trigger a crash in some circumstances, thanks
@dirceupj

see https://github.com/jcupitt/ruby-vips/issues/156
2018-03-04 15:14:06 +00:00
John Cupitt 4a59fa652c make vips_sobel()
cut out of vips_canny()
2018-02-26 18:33:20 +00:00
John Cupitt a9b4aeb13a Merge branch '8.6' 2018-02-21 19:01:43 +00:00
John Cupitt bbe42e13fa version bump 2018-02-12 12:39:53 +00:00
John Cupitt ce1f236c4d another 2x faster on hough_line 2018-02-02 09:12:31 +00:00
John Cupitt 78db92e60e better hough_line
2x faster, better parameter space, but breaks compat :( sorry
2018-02-01 20:41:14 +00:00
John Cupitt 5a4b4e196d allow remove thumbnail from exif
if the user has removed (or set to NULL) the "jpeg-thumbnail-data" tag,
remove it from the image EXIF on save

see https://github.com/jcupitt/ruby-vips/issues/147
2018-02-01 16:15:02 +00:00
John Cupitt 749f4a902a Merge branch '8.6' 2018-01-31 20:47:01 +00:00
John Cupitt e8958cb8ae improve changelog 2018-01-31 20:45:14 +00:00
John Cupitt 01eed391ab add sync locks to vips_sink()
vips_sink() used to just fire off threads willy nilly -- this could
cause problems with sequential images if a worker fell too far behind
the pack

copy over the area locking mechanism from vips_sink_memory(): new
threads are now stalled if an old thread has not finished
2018-01-31 16:25:06 +00:00
John Cupitt 421f659d33 allow 1 mode in composite
reused for all joins

see https://github.com/jcupitt/pyvips/issues/30
2018-01-30 10:12:03 +00:00
John Cupitt 5fd2ecf81d remove limit on n image in composite
composite was limited to a max of 64 images ... remove the limit

see https://github.com/jcupitt/pyvips/issues/30
2018-01-30 09:48:34 +00:00
John Cupitt 97a4ed2ca9 fix a c++ warning
see https://github.com/jcupitt/libvips/pull/864
2018-01-26 07:56:43 +00:00
John Cupitt 39406877a2 Merge branch '8.6' 2018-01-12 17:23:24 +00:00
John Cupitt 94daa18884 fix read of plane-separate, large-strip tiff
TIFFReadScanline() is too fiddly to use on plane-separate, large-strip
images ... ban it!

see https://github.com/jcupitt/libvips/issues/855
2018-01-12 17:04:47 +00:00
John Cupitt 18f530c724 Merge branch '8.6' 2018-01-12 12:02:41 +00:00
John Cupitt 24c07cfde2 revert an accidental ABI break
the new window manager code in 8.6.1 changed the prototype of an internal
function which was visible in the public API

this patch renames the function, adds it to an internal header instead,
and adds a stub for the old prototype

see https://github.com/jcupitt/libvips/issues/854
2018-01-12 11:56:17 +00:00
John Cupitt 925667f8d3 Merge branch '8.6' 2018-01-05 16:29:56 +00:00
John Cupitt 1b89d62eb5 fix a race associated with sink_screen
sink_screen was not keeping a ref to its input, so in rare conditions
it could try to make a region on a dead image
2018-01-05 16:27:44 +00:00
John Cupitt 68e0067840 note rgb->g improvement 2018-01-03 08:34:15 +00:00
John Cupitt 4c2434ab67 fix memleak in dzsave
tree elements were not being freed, thanks lovell

see https://github.com/jcupitt/libvips/issues/837
2018-01-01 11:40:04 +00:00
John Cupitt 39ab05469f Merge branch '8.6' 2017-12-31 12:57:57 +00:00
John Cupitt 9febc3ac3e seq could be set on small random images
images under the disc threshold opened in random access mode from
sequential loaders would have the seq tag set on them, causing
performance problems with vips_resize()

see https://github.com/jcupitt/libvips/issues/840
2017-12-31 12:56:11 +00:00
John Cupitt a128149009 Merge branch '8.6' 2017-12-31 10:39:36 +00:00
John Cupitt 77287a938f fix misspelling of IPTC as IPCT
the letters have been accidentally swapped for years

add a compat macro so older code still works
2017-12-31 10:23:27 +00:00
John Cupitt e12df167e6 Merge branch 'magicksave' of https://github.com/dlemstra/libvips into dlemstra-magicksave 2017-12-23 12:39:50 +00:00
John Cupitt eea8b61f3f tiny cleanup
make the code for error during jpeg buffer write a little cleaner --
rather than calling the jpeg term method ourselves, have a separate
destroy function for the write buffer
2017-12-19 08:56:51 +00:00
John Cupitt 424b359d33 bump wrapper script version
and add a test too

see https://github.com/jcupitt/libvips/issues/834
2017-12-17 10:50:57 +00:00
John Cupitt 19e2e2e208 add credit to changelog 2017-12-16 10:01:04 +00:00
John Cupitt f4f9667406 remove the 64 image limit on bandary
any number of input images now

see https://github.com/jcupitt/libvips/issues/822
2017-12-15 14:21:31 +00:00
John Cupitt 3c0a2e4837 fix window cycling
we were repeatedly free-ing and new-ing input mmap windows ... this made
things like zoom out on large images in nip2 much slower than they
needed to be
2017-12-10 17:37:07 +00:00
John Cupitt e9b7231ac0 add "extend" option to affine
so for upsizing with displacement (like resize) we can prevent dark
edges on bright images

see

https://github.com/jcupitt/php-vips/issues/61
2017-12-07 14:51:07 +00:00
John Cupitt 60bd5f6512 add composite2 to notes 2017-12-01 13:37:15 +00:00
John Cupitt 13a693c8bc Merge branch 'master' into add-extra-dzsave-tiles 2017-12-01 13:33:54 +00:00
John Cupitt 9c8790b40a setting EXIF data blocks sets other tags too
calling vips_image_set() to set the EXIF data block VIPS_META_EXIF_NAME
will automaticaly set other tags, like orientation etc.
2017-11-27 15:15:21 +00:00
John Cupitt 10eef89a7f update c++ bindings 2017-11-26 17:45:04 +00:00
John Cupitt 406e228c9b vips_resize() is always centre convention
it was corner for downsize, but should be centre to match imagemagick
2017-11-26 15:24:40 +00:00
John Cupitt 7db13412e5 deprecate centre option to resize
it's now centre on upsize, corner on downsize

see https://github.com/jcupitt/libvips/issues/705
2017-11-25 14:22:20 +00:00
John Cupitt 5664a0d9b1 dzsave outputs extra tiles along right and bottom
the deepzoom spec wants tiles to be written along the right and bottom,
even of those tiles contain no new pixels

this patch seems to work, but needs testing

see: https://github.com/jcupitt/libvips/issues/795
2017-11-24 15:54:22 +00:00
John Cupitt 6a4b249445 add dispose handling
see https://github.com/jcupitt/php-vips/issues/59
2017-11-22 17:37:31 +00:00
John Cupitt 27621733f2 add gif-comment 2017-11-22 13:10:06 +00:00
John Cupitt e56282e1fd add gif-loop metadata
see https://github.com/rokka-io/imagine-vips/issues/3
2017-11-21 16:04:18 +00:00
John Cupitt a4b89aa370 credit for affine fixup 2017-11-18 15:11:02 +00:00
John Cupitt fcec6d639b fix jaggies on the edge of affine output
and add a "background" param
2017-11-17 16:30:25 +00:00
John Cupitt 4ea743f5e6 add combine mode to find_indexed 2017-11-03 16:36:09 +00:00
John Cupitt 487c112807 add VIPS_COMBINE_MIN combining mode
for vips_compass()
2017-11-02 12:34:01 +00:00
John Cupitt 55e577a2fb rename nearest as fill_nearest
avoid a clash with the nearest-neighbour interpolator
2017-11-01 15:06:37 +00:00
John Cupitt cdc286e9d6 switch to float distance calculations
removes dithering effects along edges
2017-11-01 13:16:36 +00:00
John Cupitt 3b75b1e2ac fix gcc7 build
removed exception specs from deprecated C++ binding
2017-10-24 09:31:23 +01:00
John Cupitt 5ec1d5b72f fix vipsthumbnail --size Nx
oh dear, width but not height size specs to vipsthumbnail were not working

thanks jrochkind

see https://github.com/jcupitt/libvips/issues/781
2017-10-23 22:27:23 +01:00
John Cupitt dd503c03c6 add vips_value_set_blob_free()
simpler for language bindings to call
2017-10-19 16:37:43 +01:00
John Cupitt 68ed42e2fa make linear and cubic adaptive 2017-10-15 22:09:44 +01:00
John Cupitt 008fd21728 all done 2017-10-14 17:03:48 +01:00
John Cupitt 135d7a4dfb Merge branch '8.5' 2017-10-11 12:57:18 +01:00
John Cupitt b4a6e6e309 spelling 2017-10-11 11:24:43 +01:00
John Cupitt fd1d332892 update change notes 2017-10-11 10:12:01 +01:00
John Cupitt 40f20e5e0a Merge branch 'master' into gargsms-text-autofit 2017-10-10 13:04:31 +01:00
John Cupitt 12db3e936c Merge branch '8.5' 2017-10-09 22:35:29 +01:00
John Cupitt 6f16a9df71 fix a crash with heavy use of draw
we were leaving a few bits of the original image around after
vips_image_copy_memory(), including the progress signal ... if earlier images
were freed, perhaps by a GC in a language binding, we could get a dangling
pointer

thanks Nakilon, see https://github.com/jcupitt/ruby-vips/issues/140
2017-10-09 22:27:36 +01:00
John Cupitt 3f22424d3b test for gcc4 and ban vectors
it has severe code gen problems, it seems

this seems to ban clang as well, unfortunately
2017-10-07 11:20:21 +01:00
John Cupitt aae5babfcc Merge branch 'master' into add-composite 2017-10-01 19:37:26 +01:00
John Cupitt 560f8ac727 add goi note to changelog
see https://github.com/jcupitt/libvips/issues/741
2017-10-01 19:35:44 +01:00
John Cupitt 4b24d82e8c some cleanups, a bit quicker
it now has separate premultiplied and not-premultiplied paths
2017-09-27 17:32:05 +01:00
John Cupitt 64be1d89b5 add gravity 2017-09-20 00:43:17 +01:00