Commit Graph

162 Commits

Author SHA1 Message Date
Daniel Löbl 6bb0b4dd1e
heifsave: make it possible to use a specific encoder (#3198)
* heifsave: make it possible to use a specific encoder

* argument label: switch to leading capital letter

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

* add VipsForeignHeifEncoder enum

* correct type

* implement reviewer feedback

Co-authored-by: Kleis Auke Wolthuizen <github@kleisauke.nl>
2022-12-15 11:02:38 +00:00
John Cupitt 5569022dbd use G_GNUC_* attribute system
Instead of our own compiler attr thing.

see https://github.com/libvips/libvips/issues/2871
2022-09-23 14:37:35 +01:00
John Cupitt 6a154ac9f2 add ".pnm" save
see https://github.com/libvips/libvips/issues/3016
2022-08-30 12:31:47 +01:00
John Cupitt a9d64bea54
add dzsave to a target (#2718)
* start adding dzsave to a target

made a thing for gsf to write to a target

* fix stray tabs in dzsave

* fix dzsave write to "."

Early versions of libgsf did not support writing to ".", so we had an ugly
workaround, but this should now be OK.

Fixing this ought to make write to target simple

* dzsave_target compiles

no idea if it works though

* seems to work now

creates stray 0 length files though, very odd

* fix stray files from dzsave

next: save to buffer is returning null

* fix buffer flush in dzsave

all tests pass!

* update changelog
2022-05-20 18:38:46 +01:00
John Cupitt f8003bda67
Add tiffsave target (#2798)
* compiles, but untested

* works, but libtiff needs seek for write

next: add seek methods to target

* add target seek and read

seem to work

next: disc temps for disc output

* add libnsgif COPYING

oops, we were missing the COPYING file

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

thanks mika-fischer

* tiffsave uses a disc temp if it can

* revise temp target rules

only make a disc temp if we are writing to a filesystem target

* add new target methods to targetcustom
2022-05-20 18:38:17 +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
Kleis Auke Wolthuizen 65fbcd351b
Add missing funcs to public C API (#2692) 2022-02-27 13:42:17 +00:00
Corentin Noël 542dd06999
Refine header inclusion to allow better introspection generation (#2654)
The headers need to be self-contained for the introspection parser
to work correctly. The entry for external users remains vips/vips.h
2022-02-15 05:02:07 +00:00
John Cupitt 0c70f3dc7d
add fail-on : better control over loader error handling (#2360)
Instead of a simple fail/don't-fail boolean switch, add fail-on, an enum which sets the sensitivity of loaders to errors. 

There's a new sensitivity level which tries to detect truncated images, but ignores other types of error.
2021-10-31 14:13:18 +00:00
Kleis Auke Wolthuizen 42c8f43432
Improve doc comments (#2504)
* Fix a couple of incorrect doc comments

Helps GIR.

* Add missing doc comment for VIPS_KERNEL_MITCHELL
2021-10-29 13:37:39 +01:00
John Cupitt 47383b5bfc
tell buffer and target savers the file format (#2499)
tell buffer and target savers the file format

Currently, buffer and target savers are not told the format they should
write.

This is usually OK (the JPEG saver already knows it should write JPEG),
but some savers can write several formats, and these currently need an
extra parameter.

For example:

```ruby
buf = x.write_to_buffer ".bmp", format: "bmp"
```

The first ".bmp" gets libvips to pick magicksave, the second
`format:` param is necessary to tell magicksave to write BMP.

This patch adds stub subclasses so that the savers know the exact format. It also improves PPM save.
2021-10-28 18:57:24 +01:00
John Cupitt 0f3193b7f2
Add iiif3 (#2483)
* add iiif3 support to dzsave

some small things have changed from v2
2021-10-19 14:18:40 +01:00
Lovell Fuller 1f5d6f6bc9
Add gifsave operation, depends on cgif and libimagequant (#2381) 2021-08-22 18:11:41 +01:00
Adil Benameur 914c7cf185 added the jxl save functions to foreign.h 2021-07-19 01:28:00 +02:00
John Cupitt 7512e410ca add svgload_string
simple convenience function for C
2021-06-28 11:45:56 +01:00
John Cupitt edcdf8af70 rebase add-jp2ktiff on master 2021-04-26 15:16:20 +01:00
John Cupitt c7f69718da start adding jxl 2021-04-01 09:21:41 +01:00
John Cupitt 595f5a1b71 make autosubsample more consistent
always disable subsample for Q>=90, and update docs too
2021-03-27 15:16:38 +00:00
John Cupitt fb6891d02b typo in header 2021-03-20 14:22:06 +00:00
John Cupitt 2575d963bd add jp2k tests
and buffer load/save
2021-03-20 12:16:10 +00:00
John Cupitt 454f448c5b add jp2ksave
works, but not quite done
2021-03-19 11:49:07 +00:00
John Cupitt c2eebacf5a start adding jp2k load 2021-03-17 11:31:25 +00:00
John Cupitt 4f762d6609 add vips_niftiload_source() 2021-02-12 15:29:58 +00:00
Lovell Fuller 3ad7363104 heifsave: add option to control subsample_mode
Defaults to no subsampling when Q>90 for consistency with jpegsave.

Deprecate VipsForeignJpegSubsample enum, replace with more generic
VipsForeignSubsample.
2021-01-13 10:01:34 +00:00
John Cupitt df3b80fa40 add vipssave_target() 2021-01-02 15:49:32 +00:00
John Cupitt 42af1cec36 add vipsload_source
plus small openslideload_source fixes
2020-12-31 19:47:36 +00:00
John Cupitt babbb086f9 add openslideload_source 2020-12-30 14:14:08 +00:00
John Cupitt 633abe7be8 add missing funcs to public C API
The C API was missing vips_jpegload_source and vips_svgload_source.
Thanks to augustocdias.

See https://github.com/libvips/libvips/issues/1780
2020-08-14 13:36:12 +01:00
John Cupitt d831ad34d5 add ppm load/save to a connection
plus some more tests
2020-06-27 15:23:18 +01:00
John Cupitt 5229061360 fix doc error
Thanks MathemanFlo

see https://github.com/libvips/libvips/issues/1618
2020-04-22 11:32:21 +01:00
John Cupitt 3b57e13452 move heifsave to new target API
and add heifsave_target
2020-03-15 18:17:08 +00:00
John Cupitt 0badb7c603 add heifload_source 2020-03-15 11:45:56 +00:00
John Cupitt 764b196d50 move pdfload on top of source API
and add pdfload_source

see https://github.com/libvips/libvips/issues/1541
2020-03-11 18:15:15 +00:00
John Cupitt 1a0e61510b rewrite matrixsave
uses new target API
2020-02-22 17:55:04 +00:00
John Cupitt ce240b1ca2 revise matrixload for source API 2020-02-22 15:02:12 +00:00
John Cupitt d68e02a3c4 Merge branch 'revise-csvload' 2020-02-21 18:23:13 +00:00
John Cupitt fe47ce12e9 move csvsave to the new target API 2020-02-21 17:57:28 +00:00
John Cupitt 726895b3d1 add vips_csvload_source() 2020-02-21 16:39:40 +00:00
John Cupitt 0a23bf3578 revise formatting, add docs
fix up some formatting from https://github.com/libvips/libvips/pull/1552

plus some other small changes
2020-02-18 17:37:56 +00:00
elad laufer 00bf3269bd - fix comment 2020-02-17 17:13:01 +02:00
elad laufer d2b794ec35 - use a single enum and switch that replaces no_subsample, force_subsample 2020-02-17 11:29:57 +02:00
alon-ne f88dab9ccd
Fix gif dispose handling for DISPOSE_BACKGROUND and DISPOSE_PREVIOUS
- Add 'scratch' field to gif that holds temporary 'scratch buffer' used for rendering frames
- For DISPOSE_BACKGROUND: Set background color to transparent instead of 0
- For DISPOSE_BACKGROUND: Write background pixels into scratch after rendering current frame, so it will be used in next frame
- For DISPOSE_PREVIOUS: Save frames that are not disposed into 'previous' field in gif, when DISPOSE_PREVIOUS is specified start with that previous frame. see http://webreference.com/content/studio/disposal.html
- Add "ANIMEXTS1.0" to Application Extension parser
- Graphic Control Extension parser refactor
- Compare file contents to expected images for animated gifs in foreign tests
2020-02-06 17:36:13 +02:00
John Cupitt acabd2dc08 add gifload_source 2020-01-30 22:15:48 +00:00
John Cupitt 4c5873809f experiment with renaming stream
rename as VipsConnection, VipsSource, VipsTarget etc.

see https://github.com/libvips/libvips/issues/1494#issuecomment-569498619

renamed with this script:

```

set -e

edit() {
        sed -i -E "$1" rename
}

for i in $*; do
        cp $i rename

        edit s/VIPS_STREAMOU/VIPS_TARGET_CUSTOM/g
        edit s/VIPS_STREAMO/VIPS_TARGET/g
        edit s/VIPS_STREAMIU/VIPS_SOURCE_CUSTOM/g
        edit s/VIPS_STREAMI/VIPS_SOURCE/g
        edit s/VIPS_STREAM/VIPS_CONNECTION/g

        edit s/vips_streamou/vips_target_custom/g
        edit s/vips_streamo/vips_target/g
        edit s/vips_streamiu/vips_source_custom/g
        edit s/vips_streami/vips_source/g
        edit s/vips_stream/vips_connection/g

        edit s/VipsStreamou/VipsTargetCustom/g
        edit s/VipsStreamo/VipsTarget/g
        edit s/VipsStreamiu/VipsSourceCustom/g
        edit s/VipsStreami/VipsSource/g
        edit s/VipsStream/VipsConnection/g

        # eg. VIPS_TYPE_STREAM or VIPS_IS_STREAM
        edit "s/VIPS_([A-Z]+)_STREAMOU/VIPS_\1_TARGET_CUSTOM/g"
        edit "s/VIPS_([A-Z]+)_STREAMO/VIPS_\1_TARGET/g"
        edit "s/VIPS_([A-Z]+)_STREAMIU/VIPS_\1_SOURCE_CUSTOM/g"
        edit "s/VIPS_([A-Z]+)_STREAMI/VIPS_\1_SOURCE/g"
        edit "s/VIPS_([A-Z]+)_STREAM/VIPS_\1_CONNECTION/g"

        edit s/streamou/target_custom/g
        edit s/streamo/target/g
        edit s/streamiu/source_custom/g
        edit s/streami/source/g

        # various identifiers which also change
        edit s/is_a_stream/is_a_source/g
        edit s/find_load_stream/find_load_source/g
        edit s/find_save_stream/find_save_target/g
        edit s/new_from_stream/new_from_source/g
        edit s/write_to_stream/write_to_target/g
        edit s/vips_thumbnail_stream/vips_thumbnail_source/g

        # eg. vips_webpload_stream
        edit "s/vips_([a-z]+)load_stream/vips_\1load_source/g"

        # eg. vips_webpsave_stream
        edit "s/vips_([a-z]+)save_stream/vips_\1save_target/g"

        mv rename $i
done
```
2019-12-29 21:40:21 +00:00
John Cupitt 9a3842919a add mmap ppm input 2019-11-15 15:56:28 +00:00
John Cupitt 55024c71ce
Merge branch 'master' into add-stream-object 2019-11-12 14:08:02 +00:00
John Cupitt f5a4f41edf rename VipsStream* variables
The convention is now:

	VipStreami *streami;

We had `input` in many places, a left-over from the old VipStreamInput
name.
2019-11-11 09:09:34 +00:00
John Cupitt f499cefb0e add iiif layout to dzsave 2019-11-09 20:40:39 +00:00
Kleis Auke Wolthuizen 51ac7a6d8c WiP: Add radload stream/buffer
TODO: Does streamib supports non-seekable streams?
(cherry picked from commit bc99b26b4e0326267ffea3b34d5e4a67c7866c1b)
2019-11-08 16:04:54 +00:00
John Cupitt 23663e8a88 add formatted output streams
you can printf() to output streams, implemented radiance stream write as
a test
2019-10-29 17:43:51 +00:00