Commit Graph

4213 Commits

Author SHA1 Message Date
John Cupitt 5fae93bc61 faster and simpler magickload
but tests are failing now
2016-07-08 22:38:14 +01:00
John Cupitt a5d9cf204c seems to work, needs more testing 2016-07-08 17:56:30 +01:00
John Cupitt 40f8a8af85 add autoconf stuff
todo:

- copypaste magick2vips into magick7load

- move to magick7 API

- test with magick6 and GM too, of course

see https://github.com/jcupitt/libvips/issues/480
2016-07-08 10:45:29 +01:00
John Cupitt 0f2d1a6b0b improve docs 2016-07-08 09:15:56 +01:00
John Cupitt 3130b9b118 add note on Peter's CM work 2016-07-05 08:48:08 +01:00
John Cupitt 65067fd58b add some more auto init
vips_image_new_from_file() was missing a check_init
2016-07-04 14:51:00 +01:00
John Cupitt b81ac67a98 tag tiff alpha as UNASSALPHA
we were using ASSOCALPHA, but that's only for pre-multiplied alpha
channels
2016-07-04 14:49:04 +01:00
John Cupitt 0c2259d34b improve similarity docs
rotation direction was wrong, add type comments

https://github.com/jcupitt/libvips/issues/475
2016-06-28 17:07:14 +01:00
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 6f52f14fc5 fix comment 2016-06-19 09:37:26 +01:00
John Cupitt 3c7ce5f6fe better invalid test 2016-06-18 19:42:43 +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 d56cd4dcb2 note py problem 2016-06-17 09:36:04 +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 58be330714 oop problems found in reducev 2016-06-14 14:56:56 +01:00
John Cupitt eb7768ff61 Merge branch 'master' into add-assignment-overloads 2016-06-11 20:15:42 +01:00
John Cupitt 83b1c33441 add tests for C++ += etc
all seems to work!
2016-06-11 20:14:48 +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 93951fd04a start adding 2016-06-10 14:57:46 +01:00
John Cupitt 6fa665d6de notes 2016-06-10 14:45:33 +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 e2ca92e104 better dsave zip compression on older libgsfs
if you ask for compression on an older libgsf, you now get zlib default,
rather than no compression
2016-06-09 11:58:01 +01:00
John Cupitt 98bceec23f small dzsave cleanups
- rename compression_level as deflate_level to match libgsf convention
- use libgsf enums for GSF_ZIP_STORED, etc.
- configure-time checks for zip64 and deflate-level
- off-topic: rename NEED_TYPE_INIT as HAVE_TYPE_INIT for consistency
2016-06-09 09:36:37 +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 88acc23e2b Merge pull request #461 from felixbuenemann/dzsave-zip-compression
Vips dzsave zip compression support
2016-06-08 13:51:35 +01:00
John Cupitt 6139c4ca7d Merge pull request #468 from felixbuenemann/re-enable-travis-on-all-branches
Re-enable Travis CI builds on all branches
2016-06-07 18:51:52 +01:00
Felix Bünemann 836c2339cf Target master branch for Travis CI build badge 2016-06-07 14:12:32 +02:00
Felix Bünemann d7a39668e4 Revert "only run travis on master and stable"
This reverts commit 43e6e5361b.
2016-06-07 14:02:23 +02: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 55e5732d85 Merge branch 'master' into free-non-worker-buffers 2016-06-06 11:13:24 +01:00
John Cupitt 37131e5834 not working tests 2016-06-06 11:03:31 +01:00
John Cupitt 43e6e5361b only run travis on master and stable
don't run travis for pushes to branches other than master and stable ...
without this, we can't push non-passing changes to any branch without
breaking our travis badge
2016-06-06 07:10:26 +01:00
John Cupitt 3c696d9a18 notes about sharp needs 2016-06-06 06:39:34 +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 cf56b43ebf notes 2016-06-05 16:34:10 +01:00
John Cupitt 05ef6a5af8 Merge pull request #438 from felixbuenemann/run-python-tests-on-travis
Run python tests on travis and setup build matrix
2016-06-04 11:42:39 +01:00
John Cupitt a647ee36ba Merge pull request #463 from jcupitt/revert-462-better-dzsave-zip64-checks
Revert "[WIP] More accurate dzsave zip size estimation"
2016-06-04 10:44:19 +01:00
John Cupitt 94b39bfe62 Revert "[WIP] More accurate dzsave zip size estimation" 2016-06-04 10:43:51 +01:00
John Cupitt 9c9074dfc0 Merge pull request #462 from felixbuenemann/better-dzsave-zip64-checks
[WIP] More accurate dzsave zip size estimation
2016-06-04 10:35:05 +01:00
Felix Bünemann b1518a0d5d More accurate dzsave zip size estimation
This improves the checks on when to abort dzsave due to lack of ZIP64
support in libgsf. ZIP64 is required for archives/files larger than 4GB
and if more than 65535 files need to be stored, which is the more likely
limit to hit when saving zoom images.

* Add check to abort when exceeding the 64k file limit
* Modify size check to account for per file and directory overhead

The previous estimation was ways off, subtracting only 100k for overhead
when the actual overhead would be several megabytes for file counts near
the limit.

Estimation Basis:

Per file overhead: 30B fixed size fields + filename + extras
Central directory overhead: 46B fixed size fields + filename + extras
End of central directory: 22B fixed size fields

ZIP64 specific header sizes are not estimated, because the checks are
only done if zip64 support is lacking.

In order to estimate the variable space for filenames we need to track
the total length of all filenames and double that, because the filename
is stored in both the local file header and the central directory.

Because we don't know how big the blank tile and metadata files will be,
we subtract 64k from the max size and also leave room for up to 3 more
files (blank tile, metadata, vips properties).
2016-06-04 07:01:38 +02:00
Felix Bünemann 1f9e81309e Add dzsave zip compression support 2016-06-04 02:14:46 +02:00
Felix Bünemann e42ddd7f7c Rename dzsave no_compression to is_zip 2016-06-03 21:37:25 +02: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
Felix Bünemann 14a64c7b4c Configure Travis CI matrix build
The following environments are used:

* Ubuntu Precise (only cli tests are run)
* Ubuntu Trusty (cli and python tests)
* Mac OS X 10.11 / Xcode 7.3 / mozjpeg (cli and python tests)
2016-06-03 00:50:53 +02:00
Felix Bünemann e71c247764 Make sure test_formats.sh exits on errors
This is required to make sure we fail if a vips command fails, eg. due
to a missing fixture.
2016-06-02 23:10:14 +02:00