Commit graph

10 commits

Author SHA1 Message Date
Bruno Lopes
ed3611efa6 app, libgimp*, plug-ins: Use strncpy_s on Windows to fix CRT_INSECURE_DEPRECATE 2026-03-31 13:31:33 -03:00
Bruno Lopes
71c3f29df8 plug-ins: Fix warnings about unused profile_label and cmyk_profile in file-jp2 2026-03-17 22:30:47 -03:00
Alx Sa
f64c9c23ba plug-ins: Mitigate ZDI-CAN-28863
Resolves #15969

It is possible to set the number of color components
in the JPEG 2000 file separate from the color space,
and OpenJPEG reports that value as-is. This can result
in a buffer overflow if the num_components variable is
larger than the number of channels in the color space.

This patch adds a check to make sure num_components
is within range. If it's larger, then we clamp it to the maximum
value for that color model.
2026-03-12 13:48:45 +00:00
Alx Sa
13acebd200 plug-ins: Correct JPEG2000 export quality setting
Resolves #15684
In addition to setting the tcp_distoratio parameter to
the user's preferred quality, we also needed to enable
the cp_fixed_quality setting in OpenJPEG to actually
compress JPEG2000 images with different quality values.

Additionally, OpenJPEG expects the quality value to range
from 1.0 to 100.0, while we had it as 0.0 to 1.0. This patch
fixes both issues.
2026-01-15 13:20:40 +00:00
Alx Sa
cd1c88a036 plug-ins: Mitigate ZDI-CAN-28248 for JP2 images
Resolves #15285
Per the report, it's possible to exceed the size of the pixel buffer
with a high precision_scaled value, as we size it to the width * bpp.
This patch includes precision_scaled in the allocation calculation.
It also adds a g_size_checked_mul () check to ensure there's no
overflow, and moves the pixel and buffer memory freeing to occur
in the out section so that it always runs even on failure.
2025-11-12 13:25:44 +00:00
Sabri Ünal
814b66a887 plug-ins: Fix Title Case usages 2025-11-10 13:02:05 +01:00
Alx Sa
0faa10ddd6 plug-ins: Remove metadata on J2K and PSB export
Exiv2 does not yet support metadata export for PSB
and J2K export. For now, we will turn off the metadata
options when exporting in these formats.
2025-08-31 13:22:28 +00:00
Anders Jonsson
3f13511015 plug-ins: make JPEG 2000 codestream title translatable 2025-08-15 18:31:32 +02:00
Alx Sa
c35abbe090 plug-ins: Fix signed JPEG 2000 import
Our JPEG 2000 plug-in assumed all imported images
are unsigned - however, it's possible to store signed data
as well.
This patch adds a check to see if the image has the `sgnd`
flag set to TRUE. If so, we offset the signed data to get it
into the unsigned range before converting to an image.
2025-08-14 05:27:26 +00:00
Advance Software
19c57a9765 plug-ins: Add support for JPEG 2000 export 2025-06-03 09:22:14 -04:00
Renamed from plug-ins/common/file-jp2-load.c (Browse further)