Skip to content

Commit 9514397

Browse files
committed
Updated FreeImageRe -> v4.1.0
1 parent 02a2a84 commit 9514397

File tree

8 files changed

+104
-7
lines changed

8 files changed

+104
-7
lines changed

3rdParty/freeimage/Readme.md

Lines changed: 95 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,33 @@ Same to the original FreeImage [dual license](https://freeimage.sourceforge.io/l
1414
All changes are described below in this file.
1515

1616

17+
### Python bindings
18+
19+
To import FreeImage python package do the following steps:
20+
21+
* On Windows make link FreeImage.pyd ==> FreeImage.dll (a hard link is generated automatically when built from sources)
22+
* On Linux make link FreeImage.so ==> libFreeImage.so (a symbolic link is generated automatically when built from sources)
23+
* Make sure the link and library is available on PYTHONPATH (https://docs.python.org/3/extending/building.html)
24+
25+
```python
26+
27+
import FreeImage as fi
28+
29+
img = fi.load(r"myimage.jpg", fi.JPEG_EXIFROTATE) # Loads as numpy array
30+
...
31+
32+
img, format = fi.loadf(r"myimage.bin") # Returns image and format enum deduced from name or file data
33+
...
34+
35+
import numpy
36+
zero = numpy.zeros((128, 128), dtype=numpy.float32)
37+
fi.save(fi.FIF_EXR, zero, "zero.exr") # Accepts 2D or 3D numpy arrays
38+
...
39+
40+
41+
```
42+
43+
1744
### What's new
1845

1946
Changes made to FreeImage v3.18:
@@ -55,6 +82,73 @@ Version 0.2:
5582
- Updated LibRaw till v0.21.2
5683

5784
Version 0.3:
58-
- Fixed the vulnerability CVE-2023-47993
85+
- Fixed the vulnerabilities: CVE-2021-33367, CVE-2023-47992, CVE-2023-47993, CVE-2023-47994, CVE-2023-47995, CVE-2023-47996, CVE-2023-47997
5986
- Added API for querying versions of compiled dependencies
87+
- Added Python3 bindings
88+
- Ability to enable/disable each image library dependency
89+
- FreeImage_ConvertToRGBF supports FI_DOUBLE input
90+
- Limited support of 2bit bitmaps
91+
- Updated OpenEXR till v3.3.0
92+
- Updated LibPNG till v1.6.44
93+
- Updated jpeg-turbo till v3.0.4
94+
- Updated LibTIFF till v4.7.0
95+
- Updated LibWebP till v1.4.0
96+
- Updated LibRaw till v0.21.3
97+
98+
Version 0.4:
99+
- Building with libjpeg-turbo by default
100+
- Introduced a new Plugin2 API for plugins with state
101+
- Added a limited support for HEIC and AVIF formats
102+
- Extended FIF_* enums range and added function for mapping FIF index to FIF value
103+
- Updated jpeg-turbo till v3.1.0
104+
- Updated OpenEXR till v3.3.3
105+
- Updated OpenJPEG till v2.5.3
106+
- Updated LibPNG till v1.6.48
107+
- Updated LibRaw till v0.21.4
108+
- Updated LibWebP till v1.5.0
109+
- Updated LibSvtav1 till v3.0.2
110+
- Updated LibDav1d till v1.5.1
111+
- Updated LibKvazaar till v2.3.1
112+
- Updated LibDE265 till v1.0.15
113+
- Updated LibHEIF till v1.19.7
114+
115+
Version 0.5:
116+
- Updated LibDE265 till v1.0.16
117+
- Updated jpeg-turbo till v3.1.2
118+
- Updated LibKvazaar till v2.3.2
119+
- Updated OpenEXR till v3.3.5
120+
- Updated OpenJPEG till v2.5.4
121+
- Updated LibPNG till v1.6.50
122+
- Updated LibSvtav1 till v3.1.2
123+
- Updated LibTIFF till v4.7.1
124+
- Updated LibWebP till v1.6.0
125+
- Updated LibHEIF till v1.20.2
126+
127+
Version 4.0.0:
128+
- New versioning: FreeImageRe 4.0 as next step after FreeImage 3.18
129+
- Added support of extra TIFF image formats
130+
- Added support for opening FIMULTIBITMAP from Unicode path
131+
- Added support for 2-level dependencies info reporting
132+
- Added new version of API for processing diagnostic messages
133+
- Fixed infinite loop in TIFF thumbnail loading
134+
- Fixed multiple CVEs in TIFF, RAS, ICO, HDR, PSD, XBM, EXR, JXR plugins.
135+
- Fixed compilation for x32
136+
- Updated jpeg-turbo till v3.1.3
137+
- Updated OpenEXR till v3.4.4
138+
- Updated LibPNG till v1.6.54
139+
- Updated LibRaw till v0.22.0
140+
- Updated LibDav1d till v1.5.3
141+
142+
Version 4.1.0:
143+
- New plugin support .jxl format, OpenXL
144+
- Added libjxl v0.11.1
145+
- Added brotli v1.2.0
146+
- Added highway v1.3.0
147+
- Added Little-CMS v2.18, at hash 6ae7e97c
148+
- Fixed MacOX compilation
149+
- Fixed read-after-free error in PluginTIFF
150+
- Fixed backward compatible behaviour of FreeImage_GetFIFCount()
151+
- More accurate refcounting and deinitialization
152+
- Updated version macro in FreeImage.h
153+
60154

3rdParty/freeimage/include/FreeImage.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@
3737

3838
// Version information ------------------------------------------------------
3939

40-
#define FREEIMAGE_MAJOR_VERSION 3
41-
#define FREEIMAGE_MINOR_VERSION 18
40+
#define FREEIMAGE_MAJOR_VERSION 4
41+
#define FREEIMAGE_MINOR_VERSION 1
4242
#define FREEIMAGE_RELEASE_SERIAL 0
4343

4444
#define FREEIMAGE_RESURRECTED 1
@@ -421,6 +421,7 @@ FI_ENUM(FREE_IMAGE_FORMAT) {
421421
FIF_JXR = 36,
422422
FIF_HEIF = FIF_MAX_USER_ID + 1,
423423
FIF_AVIF,
424+
FIF_JPEGXL
424425
};
425426

426427
/** Image type used in FreeImage.
@@ -733,8 +734,9 @@ FI_STRUCT (FIDEPENDENCY) {
733734

734735
// Load / Save flag constants -----------------------------------------------
735736

736-
#define FIF_LOAD_NOPIXELS 0x8000 //! loading: load the image header only (not supported by all plugins, default to full loading)
737+
#define FIF_LOAD_NOPIXELS 0x8000 //! loading: load the image header only (not supported by all plugins, default to full loading)
737738
#define FIF_LOAD_NOTHUMBNAIL 0x10000
739+
#define FIF_LOAD_NOEXIF 0x20000
738740

739741
#define BMP_DEFAULT 0
740742
#define BMP_SAVE_RLE 1

3rdParty/freeimage/include/FreeImage.hpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ namespace fi
118118
eWebp = FIF_WEBP,
119119
eJxr = FIF_JXR,
120120
eHeif = FIF_HEIF,
121-
eAvif = FIF_AVIF
121+
eAvif = FIF_AVIF,
122+
eJpegXL = FIF_JPEGXL
122123
};
123124

124125
enum class ImageType
@@ -797,7 +798,7 @@ namespace fi
797798

798799
template <typename Deleter_ = BitmapDeleter>
799800
explicit
800-
Bitmap(FIBITMAP* handle, Deleter_&& deleter = BitmapDeleter{})
801+
Bitmap(FIBITMAP* handle, Deleter_&& deleter = Deleter_{})
801802
: mHandlePtr(handle, std::move(deleter))
802803
{
803804
if (!mHandlePtr) {
@@ -1392,7 +1393,7 @@ namespace fi
13921393

13931394
template <typename Deleter_ = MultiBitmapDeleter>
13941395
explicit
1395-
MultiBitmap(FIMULTIBITMAP* handle, Deleter_&& deleter = MultiBitmapDeleter{})
1396+
MultiBitmap(FIMULTIBITMAP* handle, Deleter_&& deleter = Deleter_{})
13961397
: mHandlePtr(handle, std::move(deleter))
13971398
{
13981399
if (!mHandlePtr) {
7.07 MB
Binary file not shown.
-3.9 MB
Binary file not shown.
4.04 MB
Binary file not shown.
26 KB
Binary file not shown.
0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)