Commit Graph

41 Commits

Author SHA1 Message Date
5d76ae7db2 Updated HEIF plug-in
With libheif 1.10, visually lossless export is possible
for 10/12 bit depths too.
2020-12-17 13:46:09 +01:00
c2ba474c81 plug-ins: register file-heif proc on init() instead of query().
Same as commit d48dae7181 but for libgimp 2.10 API.
2020-10-26 18:26:48 +01:00
e526da2345 HEIF plug-in: runtime detection of supported formats
Lossless option switch to YUV444 format when save depth is 8bit.
I would like to enable YUV444 for 10,12bit depth
in the future too, but there is issue in libheif.
2020-10-25 13:36:57 +01:00
59a1dff35e Issue #5788: 10/12 bpc in HEIF export does not mean HDR.
Similar to commit 05bb84ebed on master.
2020-10-19 20:48:50 +02:00
1202c2555b Fix a GUI bug in HEIF/AVIF export dialog. 2020-10-10 14:19:53 +02:00
6d491fbab9 Issue #5734: fix typos in if() test.
(cherry picked from commit 66dae000f9)
2020-10-08 01:37:29 +02:00
2cfdeaeb1f plug-ins: change export dialog title when exporting as AVIF.
Similar to commit 5ec3293fee on master.
2020-10-04 18:32:09 +02:00
f43f0546df Rename misleading Lossless string
The lossless option does not provide true lossless encoding yet, unfortunately.
We must rename the string to correctly inform users that the compression is not 100% lossless,
Technically the image gets converted from RGB to YUV420 format (which is lossy operation itself) and only afterwards the data are compressed lossless-ly.
2020-09-14 07:33:28 +00:00
11f7c6fabf Make strings translateable in HEIF/AVIF export dialog 2020-09-12 17:24:29 +02:00
e2f2a3f23c Updated HEIF plug-in in 2.10 branch
Backported features from master:
AVIF export (when built with >= libheif 1.8.0)
High bit export
User can select save bit depth (8, 10, 12) during export

Minor fixes in import
2020-09-09 12:37:29 +02:00
3bc240d0f5 Fix compilation with old libheif 1.3.2
High bit depth import enabled only for >= libheif 1.8.0
2020-09-08 09:17:41 +00:00
14546cf8b7 Updated HEIF plug-in
Back-porting some of the features from master:
AVIF import (need libheif >= 1.8.0)
High bit (10/12) import
NCLX color profile import (link with lcms)
Metadata import (link with gexiv2)
2020-09-06 18:33:13 +02:00
9f3823ca6b plug-ins: space invasion leaked into 2.10 file-heif, but incompletely
merge the remaining diff to master so it builds again.
2019-07-05 01:47:43 +02:00
c2f4a47f4d plug-ins: fix two harmless compiler warnings
(cherry picked from commit 738c035839)
2019-07-02 17:41:41 +02:00
262d2023fa plug-ins: some cleaning in HEIF plug-in.
heif_chroma_interleaved_24|32bit are deprecated values replaced by
heif_chroma_interleaved_RGB(A).

Also we allocated a HEIF context twice (i.e. leaking it).

Finally it's better to initialize heif_image and heif_encoder variables
to NULL because these may not be set if creation functions fail (and
it's better to fail with NULL than with garbled unset contents).

(cherry picked from commit f4af95ab95)
2019-07-02 17:30:34 +02:00
4ea2e469d4 plug-ins: improve a bit HEIF export dialog.
- Add the quality slider in a frame under the "lossless" checkbox,
  making the relationship more obvious.
- Make the whole frame contents insensitive when "lossless" is checked
  and not just the slider. Once again, it makes the relationship more
  obvious.
- Add a mnemonic to the "Lossless" checkbox and "Quality" slider.

(cherry picked from commit 7f76430090)
2019-07-02 17:30:20 +02:00
f93eb567ea plug-ins: add a "Save color profile" checkbox in HEIF export.
(cherry picked from commit dfd79ad79b)
2019-07-02 17:27:28 +02:00
ae35061fab plug-ins: implement our profile export policy for HEIF.
Same as WebP or jpeg: follow explicitly assigned profile TRC; convert
default (non-assigned) profile to sRGB, except if work format is 8-bit
linear.

(cherry picked from commit 5d6baf5f85)
2019-07-02 17:22:55 +02:00
e918a937d5 configure.ac, plug-ins: make file-heif build with older libheif again
Lower requirement to 1.3.2 and check for 1.4.0 separately. Put color
profile code in #ifdef HAVE_LIBHEIF_1_4_0.

(cherry picked from commit 62f010df90)
2019-06-25 13:23:00 +02:00
0806588b56 Issue #3532 - Wrong color profile on nikon taken photos, it's...
...always AdobeRGB!

Change all file plug-ins to never call gimp_image_metadata_load_finish()
with the GIMP_METADATA_LOAD_COLORSPACE when they loaded a color profile.

This keeps gimp_image_metadata_load_finish() from assigning a profile
from DCT even if the loaded profile was GIMP's built-in sRGB.

(cherry picked from commit a08293dc74)
2019-06-25 13:22:47 +02:00
a4b151759f plug-ins: updating deprecated enum names from libheif.
(cherry picked from commit b1133ef866)
2019-06-25 13:22:35 +02:00
1c0761053d Issue #3164: HEIC doesnt have color profile.
Since this requires libheif 1.4.0, released end of February 2019, this
commit should not go into the gimp-2-10 branch right now.

(cherry picked from commit 22e14e0b9b)
2019-06-25 13:22:23 +02:00
f97464f7bf Revert "Issue #3164: HEIC doesnt have color profile."
This reverts commit bbe3911c80.

..and not this one either.
2019-06-21 10:11:52 +02:00
f09fbbda3f Revert "plug-ins: updating deprecated enum names from libheif."
This reverts commit 85a196e711.

Didn't mean to push that one...
2019-06-21 10:11:28 +02:00
85a196e711 plug-ins: updating deprecated enum names from libheif.
(cherry picked from commit b1133ef866)
2019-06-20 19:31:09 +02:00
bbe3911c80 Issue #3164: HEIC doesnt have color profile.
Since this requires libheif 1.4.0, released end of February 2019, this
commit should not go into the gimp-2-10 branch right now.

(cherry picked from commit 22e14e0b9b)

Cherry-picked now anyway... If we allow new featues in 2.10, we must
also allow for a few updated dependencies.
2019-06-20 19:30:19 +02:00
ab851924dd plug-ins: make various usage of g_file_replace() safer.
As I did on app/, finalizing an output stream also implicitly flushes
and closes it. Hence if an export ended with an error, we'd end up with
incomplete data file (possibly overwriting a previously exported image).
Only 2 plug-ins I haven't fixed yet are file-tiff-io and file-gif-save.
The later one don't even clean up its memory (which somehow is good here
as at least the output stream is never finalized hence sane files are
not overwritten in case of errors). As for the former (TIFF plug-in), it
doesn't even seem to have any error control AFAICS, apart from printing
error messages on standard error output.

(cherry picked from commit 66ec467217)
2018-12-07 00:51:13 +01:00
e1cf340515 plug-ins: add the "msf1" brand for HEIF files.
After Dirk Farin had another look in the specs, it turns out that "mif1"
is actually allowed as major brand for HEIF. Also adding "msf1" which is
the equivalent for image sequences.

(cherry picked from commit 64b00b5c7f)
2018-09-16 22:56:07 +02:00
e4bff4c801 Issue #2209: more accurate magic for HEIF files.
Just looking for "ftyp" would also match other ISOBMFF files (.mov or
.mp4 files for instance). These are the possible 4-byte "brand" code
which can follow "ftyp", as listed by Dirk Farin from libheif.

I add the "mif1" brand, as I encountered some files using this magic
(even though this should normally not be valid apparently, yet the file
loaded fine in GIMP).

This is not perfect as the standard allows potentially very big box
headers, in which case 8 bytes (the "largesize" slot) may be inserted
between "ftyp" and the brand, as I understand it. But this is actually
unlikely enough to probably never happen (the compatible brands list
would have to be huuuge, as it looks like this is the only extendable
part in a ftyp box). So let's assume this just never happens.

See also: https://github.com/strukturag/libheif/issues/83

(cherry picked from commit 4ad3993eca)
2018-09-16 22:56:07 +02:00
e76d0941a9 Issue #2209: HEIF: Invalid input: No 'ftyp' box.
Adding a magic number for HEIC/HEIF, which would allow to discard
obvious non-HEIC images even with the wrong extension.

Note: it looks like this magic number would also match more generically
other ISO base media file format (ISOBMFF) formats, like .mov or .mp4
files. I am enquiring for better magic but for now, this is better than
nothing.

(cherry picked from commit d738d2f645)
2018-09-16 22:55:44 +02:00
a88c0ffb93 Change the license URL from http://www.gnu.org/licenses/ to https:// 2018-07-11 23:47:19 +02:00
d76a6e8c11 plug-ins: pack the file-heif load dialog's icon view cells manually
There is something broken in the obscure "text_column" and
"pixbuf_column" code in GtkIconView, and I don't have the nerve to
debug it.

Enable opening an image on activation (double click).

(cherry picked from commit 625aa514f6)

(picking the icon view change was not neccessary but this plug-in will
get more updates so let's keep the code in sync)
2018-06-12 18:36:47 +02:00
6125d225ac plug-ins: put file-heif's icon view into a scrolled window 2018-06-12 13:34:24 +02:00
3b007f70f0 plug-ins: undeprecate file-heif but only as much as can be merged to 2.10
(cherry picked from commit afd4045866)
2018-06-12 13:26:40 +02:00
40c24dc3d0 Issue #1627 - Non-existing item ID error when loading multiple-image HEIFs
Accidentially killed a line when importing the plug-in.

(cherry picked from commit 1dee517bc9)
2018-06-12 12:58:37 +02:00
9d9e9c707e plug-ins: minor cleanup.
In particular tabs were left out in the new file-heif plug-in.
2018-05-11 23:29:40 +02:00
05145f44f2 plug-ins: set appropriate status when file-heif's load_image() fails.
Current code was only taking into account cancelation, so we could end
with weird plug-in return:

> HEIF/HEIC plug-in returned SUCCESS but did not return an image

Instead properly set an error status, and echo back the error from the
plug-in or libheif.
2018-05-11 22:48:23 +02:00
b706eaf002 plug-ins: enable metadata loading in file-heif
Do it half-manually for now. Also, there doesn't seem to be metadata
saving API in libhaif.
2018-05-05 14:38:27 +02:00
15b9bb1581 plug-ins: port file-heif to GIO 2018-05-05 12:53:39 +02:00
7e3fa0c8d8 plug-ins: port file-heif to GEGL, and don't use any deprecated API 2018-05-04 21:14:23 +02:00
ba149f1759 plug-ins: add HEIF loading/saving plug-in written by Dirk Farin
Thanks a lot to Dirk for contributing this, added him to AUTHORS.

Import the code from https://github.com/strukturag/heif-gimp-plugin.git
as of today. Merged the files into a single-file plug-in. Changed
the code a lot to match our coding style, but only formatting,
no logic changes.

Still uses deprecated GimpDrawable API and no GIO, but I wanted to do
actual code changes separately from the initial import. Also disabled
metadata support because updating that to GimpMetadata was too much
for the initial import.
2018-05-04 20:49:56 +02:00