Commit Graph

27 Commits

Author SHA1 Message Date
John Cupitt a52b8e3681 fix mono fits write
we should write mono images as naxis=2

see https://github.com/libvips/libvips/issues/3265
2023-01-06 12:06:12 +00:00
John Cupitt 7f352b3c9e
revise fitsload (#3120)
* compiles

* note changelog

and switch to FATSTRIP (much quicker)

* don't duplicate header fields in fitssave

be careful not to set records twice in save

see https://github.com/libvips/libvips/issues/3113

* tiny polish
2022-11-13 18:52:28 +00:00
John Cupitt 976db37f84
Revised threading system (#3105)
* reimplement threadpool

just a set of threads that get recycled

"ninja test" passes and dzsave seems to work, though pytest fails for
some reason

* clean up threading code a bit

move base stuff into thread.c, so we have a simple

	thread -> threadset -> threadpool

layering

* start trying to revert g_threadpool

based on the original commit

* working!

nice low systime again

still need to repply cnages to threadpool.c since 80e0cc3d1

* reapply fixes from master

so threadpool.c is now up to date

* rename VipsThread as VipsWorker

a bit less confusing

* use a semaphore to count workers in a pool

* tidy up

* formatting

* dynamic threadpool sizing

based on counting the number of blocked threads in each pool

it works, but the improvement is not great :(

* add "concurrency" metadata item

so operators can hint threadpool size (dzsave especially)

* don't use thinstrip for small images

* add RGB mode to openslide

since flatten was taking 20% of CPU time for dzsave

* fix up rgb mode

now actually works

* make the tile buffer per thread

in the new openslideload rgb mode

* fix dynamic pool downsize

* mild refactoring

* fix the buffer system

oops, turned it off by mistake

* all done!

* revise changelog

* Update libvips/iofuncs/threadset.c

Co-authored-by: Kleis Auke Wolthuizen <github@kleisauke.nl>

* Update libvips/iofuncs/threadset.c

Co-authored-by: Kleis Auke Wolthuizen <github@kleisauke.nl>

* LSan: add libMagickCore to suppression file

* Revert "Remove mutex lock for VipsThreadStartFn"

This reverts commit 41440491.

* add VIPS_MAX_THREADS

to set a hard limit on the threadset size

* Revert "Revert "Remove mutex lock for VipsThreadStartFn""

This reverts commit 77e8520966ba79194fff3b4e648bbd295cd5c260.

* remove sslock from sink.c

* move fixed threadpool build to init

not first use

* add some doc comments

* revert test suite threshold change

* add a test for MAX_THREADS

and move the test tmp/ area into the builddir

* limit VIPS_MAX_THREADS to sane values

* use tabs rather than spaces

Co-authored-by: Kleis Auke Wolthuizen <github@kleisauke.nl>
2022-10-26 15:25:19 +01:00
Kleis Auke Wolthuizen 0337c09700
Cleanup gettext handling (#2695)
Use GLib's i18n support instead of copying and pasting that
logic into its own header. This deprecates the vips/intl.h
header in favour of glib/gi18n.h.
2022-02-27 15:27:28 +00:00
John Cupitt 757d031005 always check the return of vips_image_pipeline()
For consistency. Although I don't think it can meaningfully fail.
2021-06-29 16:12:17 +01:00
John Cupitt 498e9c2829 add fitsload_source
and fix some small fits loading issues
2021-02-11 16:44:53 +00:00
John Cupitt e48f45187b make RGB and sRGB synonmous
We had a half-baked idea that RGB could mean generic RGB space and sRGB
would mean strict sRGB interpretation.

Unfortunately, this did not work well in practice. For example,
`icc_transform("srgb")` would tag the result as RGB rather than sRGB
(the converter didn't know it was writing sRGB pixels, it just saw
conversion to RGB with an ICC profile), and then later stages would do
unnecessary icc_imports, or worse, fail.

This patch makes RGB and sRGB strict synonyms. If you want to treat an
RGB image as something other than sRGB, you'll need to do it by hand
with the icc_ functions.

See

https://github.com/libvips/pyvips/issues/144

46212e92b1 (r34904985)

https://github.com/libvips/libvips/issues/1494
2019-12-22 11:40:09 +00:00
John Cupitt 4f3364a2b0 skip non-image HDUs at start of fits
some fits images have header units (HDUs) at the start with extra
metadata in ... skip over these

see https://github.com/jcupitt/libvips/issues/640
2017-04-15 13:27:45 +01:00
John Cupitt ec093100fb use fits_open_diskfile(), not fits_open_file()
so we can open any filename ... fits_open_file() parses fits extended
filename formats

see https://github.com/jcupitt/libvips/issues/584
2017-01-26 20:17:29 +00:00
John Cupitt 2b72244a45 fix fitsload 2017-01-17 19:09:00 +00:00
John Cupitt 0231b512b4 fits isn't quite working still 2017-01-17 14:53:40 +00:00
John Cupitt c06dc8455b add another FITS suffix 2017-01-04 12:40:58 +00:00
John Cupitt a0b8bac8f2 load fits images to equiv. data type
so we have better support for bzero / bscale
2017-01-04 12:27:23 +00:00
John Cupitt c90b8be0b8 add tiffsave_buffer
add tests

also some cleanups to foreign include files

see https://github.com/jcupitt/libvips/issues/417
2016-10-15 12:29:14 +01:00
John Cupitt 32a8fe117e start working on --disable-deprecated
need to move im_conv() etc to classes to finish this
2014-07-25 18:06:52 +01:00
John Cupitt c85dd26627 oops, better filename set on foreign load
we were setting the filename in the wrong place
2014-06-10 13:46:05 +01:00
John Cupitt 9dea549063 oops savers were not setting filename
when we added all the buffer loaders, we cul dno longer set filename in
VipsForeign, it's now the responsibility of each load class
2014-06-10 11:26:09 +01:00
John Cupitt 5b7b3cb591 small fixes for clang static analyzer
a few small things clang static analyzer found
2013-11-22 14:34:13 +00:00
John Cupitt 12cf71a6a9 combin copy_fields and demand_hint
We had two API calls, vips_image_copy_fields() and vips_demand_hint().
They are now combined in the single vips_image_pipeline() call.

All operations are now slightly smaller and simpler.
2013-10-22 09:29:40 +01:00
John Cupitt 9d5acf79b3 fix ushort save with values >32k
we were not setting the fits offset correctly for ushort images, thanks
weaverwb
2013-06-23 04:39:59 +01:00
Benjamin Gilbert 8cc76a6ba3 Update address for Free Software Foundation
Also update LGPLv2.1 license text from the copy currently on the GNU
website.
2013-03-07 00:40:19 -05:00
John Cupitt 7e3494f6eb new new g_thread*() API 2012-10-23 13:36:39 +01:00
John Cupitt fad78f8555 rework gthread usage
glib-2.32 deprecated g_mutex_new() ... use a compat function to hide
this change

also remove the --without-threads configure flag, gthread is now
compulsory, so there was no longer any point
2012-10-22 22:08:53 +01:00
John Cupitt d0ec401a12 hackery to get goi working 2011-12-31 18:22:42 +00:00
John Cupitt 0983b50905 Merge remote-tracking branch 'origin/gobject-introspection' into goi-merge
Conflicts:
	TODO
	libvips/arithmetic/im_recomb.c
	libvips/arithmetic/im_stats.c
	libvips/deprecated/im_measure.c
	libvips/include/vips/header.h
	libvips/include/vips/image.h
	libvips/include/vips/object.h
	libvips/iofuncs/header.c
	libvips/iofuncs/image.c
	libvips/iofuncs/object.c
2011-12-24 17:36:55 +00:00
John Cupitt 7886180ae6 fixes to fits load/save 2011-12-14 13:18:50 +00:00
John Cupitt 0137186205 move fits read/write to new-style 2011-12-13 17:50:55 +00:00