Permalink
Browse files

Merge branch 'master' into add-nifti-support

  • Loading branch information...
jcupitt committed Jul 20, 2018
2 parents d03416d + d06c2fe commit 3201b4373d0b7ac150fd908da197db4dcd96d759
Showing with 4,228 additions and 161 deletions.
  1. +1 −0 .gitignore
  2. +6 −0 ChangeLog
  3. +87 −75 README.md
  4. +287 −46 libvips/foreign/exif.c
  5. +8 −3 libvips/foreign/vips2tiff.c
  6. +6 −6 m4/gif.m4
  7. +6 −6 m4/jpeg.m4
  8. +6 −6 m4/png.m4
  9. +6 −6 m4/tiff.m4
  10. +6 −6 m4/webp.m4
  11. +6 −6 m4/zlib.m4
  12. +5 −0 test/README.md
  13. BIN test/images/Landscape_6.jpg
  14. BIN test/images/avg152T1_LR_nifti.nii.gz
  15. 0 test/test-suite/__init__.py
  16. +4 −0 test/test-suite/conftest.py
  17. +232 −0 test/test-suite/helpers/helpers.py
  18. BIN test/{ → test-suite}/images/1.webp
  19. BIN test/{ → test-suite}/images/CMU-1-Small-Region.svs
  20. BIN test/{ → test-suite}/images/ISO_12233-reschart.pdf
  21. BIN test/test-suite/images/MARBLES.BMP
  22. 0 test/{ → test-suite}/images/WFPC2u5780205r_c0fx.fits
  23. BIN test/{ → test-suite}/images/blankpage.pdf
  24. BIN test/{ → test-suite}/images/blankpage.pdf.png
  25. 0 test/{ → test-suite}/images/blankpage.svg
  26. BIN test/{ → test-suite}/images/blankpage.svg.png
  27. BIN test/{ → test-suite}/images/cmyktest.pdf
  28. BIN test/{ → test-suite}/images/cogs.gif
  29. BIN test/{ → test-suite}/images/cramps.gif
  30. BIN test/{ → test-suite}/images/dicom_test_image.dcm
  31. BIN test/{ → test-suite}/images/multi-channel-z-series.ome.tif
  32. BIN test/{ → test-suite}/images/sRGB.icm
  33. BIN test/{ → test-suite}/images/sample.exr
  34. BIN test/{ → test-suite}/images/sample.mat
  35. BIN test/{ → test-suite}/images/sample.png
  36. BIN test/{ → test-suite}/images/sample.tif
  37. BIN test/{ → test-suite}/images/t00740_tr1_segm.hdr
  38. BIN test/{ → test-suite}/images/t00740_tr1_segm.img
  39. BIN test/{ → test-suite}/images/trans-x.gif
  40. BIN test/{ → test-suite}/images/trans-x.png
  41. 0 test/{ → test-suite}/images/vips-profile.svg
  42. BIN test/{ → test-suite}/images/vips-profile.svg.gz
  43. BIN test/{ → test-suite}/images/vips-profile.svgz
  44. BIN test/{ → test-suite}/images/йцук.jpg
  45. +641 −0 test/test-suite/test_arithmetic.py
  46. +155 −0 test/test-suite/test_colour.py
  47. +767 −0 test/test-suite/test_conversion.py
  48. +206 −0 test/test-suite/test_convolution.py
  49. +439 −0 test/test-suite/test_create.py
  50. +101 −0 test/test-suite/test_draw.py
  51. +787 −0 test/test-suite/test_foreign.py
  52. +114 −0 test/test-suite/test_histogram.py
  53. +93 −0 test/test-suite/test_iofuncs.py
  54. +55 −0 test/test-suite/test_morphology.py
  55. +203 −0 test/test-suite/test_resample.py
  56. +1 −1 test/variables.sh.in
@@ -1,5 +1,6 @@
.pytest_cache
compile
.pytest_cache
a.out
*.log
*.trs
@@ -31,7 +31,13 @@
- add Mitchell kernel
- pyramid builders have a choice of 2x2 shrinkers [harukizaemon]
- add `palette` option to pngsave [felixbuenemann]
<<<<<<< HEAD
- add basic nifti load/save support
=======
- support writing string-valued fields via libexif
- paste in the test suite from pyvips
- get EXIF tag names from tag plus ifd [@Nan619]
>>>>>>> master
12/3/18 started 8.6.4
- better fitting of fonts with overhanging edges [Adrià]
162 README.md
@@ -8,28 +8,25 @@ similar libraries, [libvips runs quickly and uses little
memory](https://github.com/jcupitt/libvips/wiki/Speed-and-memory-use).
libvips is licensed under the LGPL 2.1+.
It has around 300 operations covering arithmetic, histograms,
convolutions, morphological operations, frequency filtering, colour,
resampling, statistics and others. It supports a large range of numeric
formats, from 8-bit int to 128-bit complex. It supports a good range of
image formats, including JPEG, TIFF, PNG, WebP, FITS, Matlab, OpenEXR,
PDF, SVG, HDR, PPM, CSV, GIF, Analyze, DeepZoom, and OpenSlide. It can
also load images via ImageMagick or GraphicsMagick.
It has around 300 operations covering arithmetic, histograms, convolutions,
morphological operations, frequency filtering, colour, resampling, statistics
and others. It supports a large range of numeric formats, from 8-bit int
to 128-bit complex. It supports a good range of image formats, including
JPEG, TIFF, PNG, WebP, FITS, Matlab, OpenEXR, PDF, SVG, HDR, PPM, CSV, GIF,
Analyze, DeepZoom, and OpenSlide. It can also load images via ImageMagick
or GraphicsMagick.
It has APIs for
[C](http://jcupitt.github.io/libvips/API/current/using-from-c.html)
and
[C](http://jcupitt.github.io/libvips/API/current/using-from-c.html) and
[C++](http://jcupitt.github.io/libvips/API/current/using-from-cpp.html)
and a [command-line
interface](http://jcupitt.github.io/libvips/API/current/using-cli.html).
Bindings are available for
[Python](https://pypi.python.org/pypi/pyvips),
Bindings are available for [Python](https://pypi.python.org/pypi/pyvips),
[Ruby](https://rubygems.org/gems/ruby-vips),
[PHP](https://github.com/jcupitt/php-vips),
[Go](https://github.com/davidbyttow/govips),
[Lua](https://github.com/jcupitt/lua-vips),
JavaScript and others. There is full
[documentation](http://jcupitt.github.io/libvips/API/current).
[Lua](https://github.com/jcupitt/lua-vips), JavaScript and others. There is
full [documentation](http://jcupitt.github.io/libvips/API/current).
There are several GUIs as well, see the [VIPS
website](http://jcupitt.github.io/libvips).
@@ -44,105 +41,120 @@ https://github.com/jcupitt/libvips/releases
Untar, then in the libvips directory you should just be able to do:
$ ./configure
$ ./configure
Check the summary at the end of `configure` carefully.
libvips must have `build-essential`, `pkg-config`, `glib2.0-dev`,
`libexpat1-dev`.
Check the summary at the end of `configure` carefully. libvips must have
`build-essential`, `pkg-config`, `glib2.0-dev`, `libexpat1-dev`.
You'll need the dev packages for the file format support you
want. For basic jpeg and tiff support, you'll need `libtiff5-dev`,
`libjpeg-turbo8-dev`, and `libgsf-1-dev`. See the **Dependencies** section
below for a full list of the things that libvips can be configured to use.
You'll need the dev packages for the file format support you want. For basic
jpeg and tiff support, you'll need `libtiff5-dev`, `libjpeg-turbo8-dev`,
and `libgsf-1-dev`. See the **Dependencies** section below for a full list
of the things that libvips can be configured to use.
Once `configure` is looking OK, compile and install with the usual:
$ make
$ sudo make install
$ make
$ sudo make install
By default this will install files to `/usr/local`.
We have detailed guides on the wiki for [building on
Windows](https://github.com/jcupitt/libvips/wiki/Build-for-Windows)
and [building on OS
X](https://github.com/jcupitt/libvips/wiki/Build-for-macOS).
Windows](https://github.com/jcupitt/libvips/wiki/Build-for-Windows) and
[building on OS X](https://github.com/jcupitt/libvips/wiki/Build-for-macOS).
# Testing
Do a basic test of your build with:
$ make check
Run the libvips test suite with:
$ pytest
Run a specific test with:
$ pytest test/test-suite/test_foreign.py -k test_tiff
YOu will need to install a variety of Python packages for this, including
pyvips, the libvips Python binding.
# Building libvips from git
Checkout the latest sources with:
$ git clone git://github.com/jcupitt/libvips.git
$ git clone git://github.com/jcupitt/libvips.git
Building from git needs more packages, you'll need at least `swig`, `gtk-doc`
and `gobject-introspection`, see the dependencies section below. For example:
$ brew install gtk-doc swig
$ brew install gtk-doc swig
Then build the build system with:
$ ./autogen.sh
$ ./autogen.sh
Debug build:
$ CFLAGS="-g -Wall" CXXFLAGS="-g -Wall" \
./configure --prefix=/home/john/vips --enable-debug
$ make
$ make install
$ CFLAGS="-g -Wall" CXXFLAGS="-g -Wall" \
./configure --prefix=/home/john/vips --enable-debug
$ make
$ make install
Leak check:
$ export G_DEBUG=gc-friendly
$ valgrind --suppressions=libvips.supp \
--leak-check=yes \
vips ... > vips-vg.log 2>&1
$ export G_DEBUG=gc-friendly
$ valgrind --suppressions=libvips.supp \
--leak-check=yes \
vips ... > vips-vg.log 2>&1
Memory error debug:
$ valgrind --vgdb=yes --vgdb-error=0 vips ...
$ valgrind --vgdb=yes --vgdb-error=0 vips ...
valgrind threading check:
$ valgrind --tool=helgrind vips ... > vips-vg.log 2>&1
$ valgrind --tool=helgrind vips ... > vips-vg.log 2>&1
Clang build:
$ CC=clang CXX=clang++ ./configure --prefix=/home/john/vips
$ CC=clang CXX=clang++ ./configure --prefix=/home/john/vips
Clang static analysis:
$ scan-build ./configure --disable-introspection --disable-debug
$ scan-build -o scan -v make
$ scan-view scan/2013-11-22-2
$ scan-build ./configure --disable-introspection --disable-debug
$ scan-build -o scan -v make
$ scan-view scan/2013-11-22-2
Clang dynamic analysis:
$ FLAGS="-O1 -g -fsanitize=address"
$ FLAGS="$FLAGS -fno-omit-frame-pointer -fno-optimize-sibling-calls"
$ CC=clang CXX=clang++ LD=clang \
CFLAGS="$FLAGS" CXXFLAGS="$FLAGS" LDFLAGS=-fsanitize=address \
./configure --prefix=/home/john/vips
$ FLAGS="-O1 -g -fsanitize=thread"
$ FLAGS="$FLAGS -fPIC"
$ FLAGS="$FLAGS -fno-omit-frame-pointer -fno-optimize-sibling-calls"
$ CC=clang CXX=clang++ LD=clang \
CFLAGS="$FLAGS" CXXFLAGS="$FLAGS" \
LDFLAGS="-fsanitize=thread -fPIC" \
./configure --prefix=/home/john/vips \
--without-magick \
--disable-introspection
$ G_DEBUG=gc-friendly vips copy ~/pics/k2.jpg x.jpg >& log
$ FLAGS="-O1 -g -fsanitize=address"
$ FLAGS="$FLAGS -fno-omit-frame-pointer -fno-optimize-sibling-calls"
$ CC=clang CXX=clang++ LD=clang \
CFLAGS="$FLAGS" CXXFLAGS="$FLAGS" LDFLAGS=-fsanitize=address \
./configure --prefix=/home/john/vips
$ FLAGS="-O1 -g -fsanitize=thread"
$ FLAGS="$FLAGS -fPIC"
$ FLAGS="$FLAGS -fno-omit-frame-pointer -fno-optimize-sibling-calls"
$ CC=clang CXX=clang++ LD=clang \
CFLAGS="$FLAGS" CXXFLAGS="$FLAGS" \
LDFLAGS="-fsanitize=thread -fPIC" \
./configure --prefix=/home/john/vips \
--without-magick \
--disable-introspection
$ G_DEBUG=gc-friendly vips copy ~/pics/k2.jpg x.jpg >& log
Build with the GCC auto-vectorizer and diagnostics (or just -O3):
$ FLAGS="-O2 -march=native -ffast-math"
$ FLAGS="$FLAGS -ftree-vectorize -fdump-tree-vect-details"
$ CFLAGS="$FLAGS" CXXFLAGS="$FLAGS" \
./configure --prefix=/home/john/vips
$ FLAGS="-O2 -march=native -ffast-math"
$ FLAGS="$FLAGS -ftree-vectorize -fdump-tree-vect-details"
$ CFLAGS="$FLAGS" CXXFLAGS="$FLAGS" \
./configure --prefix=/home/john/vips
Static analysis with:
$ cppcheck --force --enable=style . &> cppcheck.log
$ cppcheck --force --enable=style . &> cppcheck.log
# Dependencies
@@ -160,19 +172,19 @@ them in the default path and in `$prefix`. If you have installed your own
versions of these libraries in a different location, libvips will not see
them. Use switches to libvips configure like:
./configure --prefix=/Users/john/vips \
--with-giflib-includes=/opt/local/include \
--with-giflib-libraries=/opt/local/lib \
--with-tiff-includes=/opt/local/include \
--with-tiff-libraries=/opt/local/lib \
--with-jpeg-includes=/opt/local/include \
--with-jpeg-libraries=/opt/local/lib
./configure --prefix=/Users/john/vips \
--with-giflib-includes=/opt/local/include \
--with-giflib-libraries=/opt/local/lib \
--with-tiff-includes=/opt/local/include \
--with-tiff-libraries=/opt/local/lib \
--with-jpeg-includes=/opt/local/include \
--with-jpeg-libraries=/opt/local/lib
or perhaps:
CFLAGS="-g -Wall -I/opt/local/include -L/opt/local/lib" \
CXXFLAGS="-g -Wall -I/opt/local/include -L/opt/local/lib" \
./configure --without-python --prefix=/Users/john/vips
CFLAGS="-g -Wall -I/opt/local/include -L/opt/local/lib" \
CXXFLAGS="-g -Wall -I/opt/local/include -L/opt/local/lib" \
./configure --without-python --prefix=/Users/john/vips
to get libvips to see your builds.
Oops, something went wrong.

0 comments on commit 3201b43

Please sign in to comment.