Commit Graph

13 Commits

Author SHA1 Message Date
Jacob Boerema 0585bc11d4 plug-ins: fix incorrect size when comparing jpeg exif marker in EXR loader
When defining jpeg_exr a closing \0 is automatically added by the
compiler. So when we compare it using sizeof, we do not compare
6 bytes but 7. Since there won't be three 0's, this will fail.

Fix this by reducing the size by 1 and also update the comment to
make this clear and further to add that this was changed after
darktable 4.0.0.
2024-03-07 13:12:08 -05:00
Alx Sa b459ce95bb plug-ins: Handle single-channel OpenEXR with unknown channel names
OpenEXR allows for arbitrary channel names. Instead of failing once the common ones are checked, this patch 
checks the number of channels in the file.
If there is only one channel, it is treated as 
grayscale (similar to OpenImageIO's behavior).
A debug warning with the channel name is also printed.
2023-08-10 19:37:25 +00:00
Jehan 49e534247a app, libgimp*, pdb, plug-ins: use g_memdup2() instead of g_memdup()
Since it appeared with GLib 2.68.0, we could not change this until we
bumped the dependency which has only become possible a few days ago
(since Debian testing is our baseline for dependency bumps). Cf.
previous commit.

As this is a drop-in replacement (just a guint parameter changed to
gsize to avoid integer overflow), search-and-replace with:

> sed -i 's/g_memdup\>/g_memdup2/g' `grep -rIl 'g_memdup\>' *`

… followed by a few manual alignment tweaks when necessary.

This gets rid of the many deprecation warnings which we had lately when
building with a recent GLib version.
2021-08-26 17:32:09 +02:00
Michael Natterer d223522b8b plug-ins: suppress deprecation warnings from the OpenEXR headers
"Fix" straight from stackoverflow, I have no idea how this builds
on anything except gcc or clang.
2019-07-21 19:56:29 +02:00
Michael Natterer b07975aa88 plug-ins: cleanup, copyright headers, formatting in the openexr-wrapper 2019-06-26 16:56:12 +02:00
Jehan 7a7ecda4f1 plug-ins: optionally define several float.h macros for MinGW64.
This plug-in failed to cross-build because these macros were not defined
in the `float.h` of my MinGW64 environment (and they are used in some
ilmbase headers). Just define them ourselves if they are absent. I do
this only on MinGW environment because these should really be defined on
Linux (and other UNIX-like, I guess?) and if they are not, we may have a
bigger issue.
2019-01-26 16:42:15 +01:00
Tobias Ellinghaus 3d86a6c709
plug-ins: Use GIMP's internal profile when loading EXR
... when it's appropriate.
2016-04-29 13:10:30 +02:00
Tobias Ellinghaus 4e144fea69
plug-ins: Read Xmp data from EXR files
This commit needs review as it uses an ugly hack to make
gimp_metadata_set_from_xmp() do what it wants.
2016-04-22 17:01:58 +02:00
Tobias Ellinghaus e81cef7c03
plug-ins: Read comment and Exif data from EXR files 2016-04-22 14:41:34 +02:00
Michael Natterer b70ffb0c8b plug-ins: some cleanup in the new file-exr ICC profile code 2015-09-20 23:49:38 +02:00
Tobias Ellinghaus d73cfa4a24 plug-ins: support color managed EXR loading
This generates an ICC profile from the embedded white point and
chromaticities on the fly, assuming linear gamma images.
2015-09-20 23:42:24 +02:00
Michael Natterer a4773a5599 plug-ins: include libgimp/gimp.h and gimpui.h in openexr-wrapper.cc
The file does not need the includes, but including libgimp from a C++
file makes sure the build fails if something forbidden gets added to
any public libgimp header, such as a struct member named "private".
2014-04-27 14:33:16 +02:00
Mukund Sivaraman 8d89efaff5 file-exr: Add initial implementation (loader)
This is a basic implementation of an OpenEXR loader. This
"infrastructure" is required for any further work. It consists of:

* The build system changes.

* A C wrapper around the OpenEXR library, which is necessary as it's not
  possible to intermix GIMP's code with C++ code.

* A basic image loader. Chroma is not supported currently, and some
  other weird files like multi-view files are unsupported. These can be
  added when necessary. There is no UI, but it should be straightforward
  to add new features like this on top of this work.
2013-05-04 13:02:54 +05:30