Commit Graph

48 Commits

Author SHA1 Message Date
John Cupitt 43ab4bf886 tiny formatting changes 2022-12-15 11:15:01 +00:00
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
Kleis Auke Wolthuizen 0629a5de7f
Ensure consistent formatting of `->format_table` (#3199) 2022-11-30 09:41:05 +00:00
John Cupitt ab2e0bf38c Merge branch '8.13' 2022-10-11 08:49:03 +01:00
John Cupitt fbef674625 better rules for 16-bit heifsave
now parallel 16-bit PNG save

see https://github.com/libvips/libvips/discussions/3087
2022-10-11 08:45:24 +01:00
John Cupitt a928c9a885 a little more dbg output in heifsave 2022-08-11 10:30:23 +01:00
Kleis Auke Wolthuizen 1214f942f9
Prefer to use `flags |=` everywhere (#2854)
Use the bitwise OR assignment operator to ensure that derived
classes does not overwrite the flags from the base class. Also,
move the flags from `openslideload_source` to its base class.
2022-06-11 15:40:39 +01:00
John Cupitt 58b53506ff
add vips_target_end (#2802)
since finish did not return an error code

also make sure we don't call target_end from inside _dispose, since that
can't signal error either

see https://github.com/libvips/libvips/issues/2801
2022-05-20 16:38:04 +01:00
Lovell Fuller 7e64c48ca9
heifsave: allow creation of EXIF metadata (#2794)
Previously only update of input EXIF was possible
2022-05-10 08:14:53 +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
Kleis Auke Wolthuizen 50a74ceeec
Mark some functions and variables as static (#2691)
These are only used in the same file, and not exported.
2022-02-27 13:41:39 +00:00
John Cupitt e985e23c09
add HDR support to heif load/save (#2596)
* heifload done, doing save

* finish save, add tests, docs
2022-02-18 11:16:15 +00:00
John Cupitt 56a7916e80 remove stray error messages 2022-01-09 12:20:25 +00: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 ff1260df1c rename heifsave "speed" param as "effort"
For consistency with the rest of libvips. "speed" still works.
2021-07-30 10:59:12 +01:00
John Cupitt def025da3e reorganise loadable modules
- heifload operation now defined in heifload.c, etc.
- C API wrappers moved to foreign.c
2021-05-17 09:45:27 +01:00
John Cupitt 5d9b60bcd5 revise heifsave docs 2021-05-01 14:48:06 +01:00
Kleis Auke Wolthuizen 2b1daff256 Build a dynamically loadable module for libheif
By default, a dynamically loadable module is built for libheif (i.e.
`--with-heif=module`) when:
* libheif is found;
* GModule is supported (`gmodule_supported` pkg-config variable).

This can be overridden on the command line with:
* `--without-heif` - to disable libheif usage;
* `--with-heif[=yes]` - to restore the previous behavior;
* `--disable-modules` - to disable the build of dynamic modules.
2021-04-22 12:28:37 +02:00
John Cupitt 69fcf1b9e9
Merge branch 'master' into add-openjpeg 2021-03-27 15:22:13 +00: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 8c4486327e heifsave defaults to AV1 for .avif suffix 2021-03-26 09:50:17 +00:00
Philipp Trulson 13a4d9f7ea
Set correct description for heifsave argument 2021-03-24 22:57:06 +01: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 5918af917e more debugging code for heifload and save
and fix an assert fail with debugging enabled on recent libheif
2020-12-24 15:50:56 +00:00
Lovell Fuller 2403b29c1f libheif: expose speed parameter (currently AV1 compression only)
Supports both aom and rav1e encoders by limiting to a 0-8 range.

(The rav1e encoder accepts speed values of 9 and 10 but these
use 64x64 blocks more suited to video than images.)
2020-09-16 19:22:45 +01:00
John Cupitt 0617165c66 raise minimum libheif version to 1.3
We didn't compile with anything less than 1.3 anyway.

see https://github.com/libvips/libvips/issues/1817
2020-09-15 10:18:38 +01:00
John Cupitt 72ca38cab0 only rebuild heif exif if we have to
and fix write of XMP write in heic
2020-07-19 02:06:36 +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 686829166d fix some more metadata updates
some more minor cases picked up by the test suite
2019-11-30 12:11:23 +00:00
John Cupitt acd9101037 always copy before exif_update
During write, we often call vips__exif_update(). This updates the exif
block from the other image metadata prior to save.

Always copy the image before calling this.

See https://github.com/lovell/sharp/issues/1986
2019-11-28 14:45:02 +00:00
John Cupitt 8ddbfbaf0c fix RGBA heifsave
we need to set plane bits as well

see https://github.com/libvips/libvips/issues/1411
2019-09-01 20:55:25 +01:00
John Cupitt da8cee048f enable alpha in heifsave
Check for image alpha and enable it. There seem to be some
non-transparent tiles, curiously.

See https://github.com/libvips/libvips/issues/1411
2019-09-01 16:58:50 +01:00
John Cupitt 8b1817ddd0 fix a couple of clang warnings 2019-08-09 15:22:56 +01:00
John Cupitt 8cb2b613b7 note new heifsave param in changelog
plus tiny reformatting
2019-07-03 15:04:58 +01:00
Lovell Fuller 42f9f78c86 heifsave: expose compression option
improve error messaging, add further suffixes
2019-07-03 13:07:58 +01:00
John Cupitt 3e60e816ed split heifload / heifsave
test for libheif supporting decode and encode, and turn heifload and
heifsave on and off
2019-05-08 21:13:00 +01:00
John Cupitt 8b71d0179c Merge branch 'master' into revise-thumbnail 2019-04-23 20:27:30 +01:00
John Cupitt e14ae48a67 fix heifsave on ubuntu 18.04 2019-03-14 13:33:11 +00:00
John Cupitt 928fff5168 try to fix heifload for ubuntu 18.04 2019-03-14 13:04:26 +00:00
John Cupitt 15ee957ea9 Merge branch 'master' into revise-thumbnail 2019-03-02 22:06:23 +00:00
John Cupitt cae57d5670 make heif load/save work with 1.3.2 2019-02-20 12:30:12 +00:00
John Cupitt cf860b27fa start working over thumbnail to support anim 2019-02-19 17:27:23 +00:00
John Cupitt 622c08b562 set primary on heifsave 2019-01-30 11:37:01 +00:00
John Cupitt 4a461e2507 fix data return from heifsave_buffer 2019-01-30 04:18:49 +00:00
John Cupitt 62ba86cfd0 add heif buffer save 2019-01-29 17:21:13 +00:00
John Cupitt a837b66cc1 add strip support to heicsave 2019-01-29 16:53:39 +00:00
John Cupitt cae7838f86 heifsave seems to work 2019-01-29 16:40:34 +00:00
John Cupitt a833764878 start heifsave 2019-01-29 10:27:00 +00:00