Commit Graph

18 Commits

Author SHA1 Message Date
John Cupitt a7e754162a
move tiff decompress outside lock (#2969)
* move tiff decompress outside lock

Most time in TIFF read is spent in decompression. If we move this
outside the lock, we can get a useful speedup.

This commit adds the machinery to move the lock to before decompress, so
jp2k decompression is now threaded.

Before:

```
$ vips copy wtc.jpg x.tif[tile,compression=jp2k]
$ time vips avg x.tif
117.249845
real	0m15.085s
user	0m16.155s
sys	0m0.109s
```

After:

```
$ time vips avg x.tif
117.249845
real	0m1.207s
user	0m18.384s
sys	0m0.369s
```

* start moving jpg decode outside the lock

* move jpeg decompress outside the lock

seems to work

* add some more tile size checks

double-check jpeg tile size before decode

* fix tiffload demand hinting

We were not setting the hint correctly in header load, and we were not
hinting smalltile for tiled TIFFs.
2022-09-03 13:10:58 +01:00
Kleis Auke Wolthuizen 07edfe37b1
Improve symbol visibility (#2688)
* Improve symbol visibility

* Decorate required internal symbols with VIPS_API

* Remove a couple of stray header decls

* Incorporate review comment

- Ensure symbol visibility is also set on static libraries.
- Prefer to use `cc.has_function_attribute('visibility:hidden')`.

* Don't export internal deprecated symbols

* Move deprecated symbols to vips7compat.h

* `IM_FORMAT_H` -> `VIPS_FORMAT_H`

* Move `vips_window_ref` compat stub to `vips7compat.c`

* Disable deprecation warnings internally

* `vips_image_get_kill` -> `vips_image_iskilled`

* Ensure API compatibility

* Add missing include directives

* Move `vips__init` decl to vips7compat

* Move `vips__get_sizeof_vipsobject` to vips7compat

* Fix introspection build

* Fix 2 introspection warnings

* Ensure compatibility with vipsdisp

/usr/bin/ld: tilesource.o: in function `tile_source_new_from_source':
vipsdisp/tilesource.c:1627: undefined reference to `vips__region_no_ownership'
2022-04-16 10:58:55 +01:00
John Cupitt 5117c1a980 remove mode_t from headers
it seems to fail with MSVC.

int works fine, and is what g_open() uses.
2020-07-04 18:28:44 +01:00
Kleis Auke Wolthuizen 9246094033 Fix function pointer cast issues
It is undefined behavior in C and C++ to cast a function pointer
to another type and call it that way. This does work in most native
platforms, however, despite it being UB, but in WASM it can fail.

See:
https://emscripten.org/docs/porting/guidelines/function_pointer_issues.html
2020-06-30 13:35:41 +02:00
Kleis Auke Wolthuizen 6fc2015783 Remove use of varargs in vips_*_open
This matches the declaration of g_open and helps tools (such as ASan) when
running on non-native platforms.
2020-04-27 11:56:32 +02:00
John Cupitt 440b3a3362 fix up -DVIPS_DEBUG build 2013-07-15 10:49:49 +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 52c8678b23 flush on too many open files
start to drop cached operations when there are too many files open

also, CLI args to control the cache limit, and more informative
--vips-leak messages
2011-11-02 14:51:39 +00:00
John Cupitt 2959dbff39 oops memory problems
removed unnecessary and broken im_malloc() compat functions, fixed a
memleak
2011-09-23 12:27:37 +01:00
John Cupitt 5462d5d6b2 switch buffer allocation to tracked
buffer allocs and image memory allocs go to the tracked pool
2011-09-21 18:00:03 +01:00
John Cupitt 9c84b0dfd9 add vips_tracked_malloc()
new malloc()/free() pair do tracked allocations ... use g_new()/g_free()
everywhere else
2011-09-21 14:50:32 +01:00
John Cupitt 4b2c8587b2 vips_malloc() size tracking
vips_malloc() now tracks allocation size and can report total mem use.
It seems to trigger quite a few nip2 bugs though, I guess we are
g_free()ing the result in places (or vice versa).

======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x78a8f)[0x2aae8e011a8f]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x73)[0x2aae8e0158e3]
/home/john/vips/lib/libvips.so.15(vips_free+0xc2)[0x2aae88f7717e]
/home/john/GIT/nip2/src/nip2[0x4c9ce2]
/home/john/GIT/nip2/src/nip2(path_map_exact+0x63)[0x4ca127]
/home/john/GIT/nip2/src/nip2[0x4b5381]
2011-09-19 16:44:51 +01:00
John Cupitt 842d2e1b16 more more stuff to vips_
window, memory, buffer, b64 all moved to the vips_ namespace
2011-03-25 14:01:12 +00:00
John Cupitt 6b9ddf6f54 up to REGION now
more hackery, we've now reached REGION
2011-03-02 14:13:05 +00:00
John Cupitt 7a704bad50 more VipsImage hackery
getting closer to compiling
2011-02-21 09:16:17 +00:00
John Cupitt 7f081f4d54 more hackery
headers compile now, just about, working on image.c
2011-02-16 14:40:31 +00:00
John Cupitt 0d2bdac332 gtk-doc fixes 2010-10-22 13:49:36 +00:00
John Cupitt 10be46594d memroy docs 2009-10-20 16:15:39 +00:00