Skip to content

Commit

Permalink
Update a number of 3rd-party libraries
Browse files Browse the repository at this point in the history
Relates to #556

I've spent the week building 64-bit versions of various support libraries, and figured I'd update them to their newest versions while I was at it.

The following libraries are updated here:

- libdeflate
- libwebp
- lz4
- pdfium
- resvg
- zstd

This should bring various performance and stability improvements to the image formats where these libraries are involved.
  • Loading branch information
tannerhelland committed May 3, 2024
1 parent 4faf7ac commit 1eddfd6
Show file tree
Hide file tree
Showing 15 changed files with 42 additions and 42 deletions.
File renamed without changes.
File renamed without changes.
Binary file modified App/PhotoDemon/Plugins/libdeflate.dll
Binary file not shown.
Binary file modified App/PhotoDemon/Plugins/libsharpyuv.dll
Binary file not shown.
Binary file modified App/PhotoDemon/Plugins/libwebp.dll
Binary file not shown.
Binary file modified App/PhotoDemon/Plugins/libwebpdemux.dll
Binary file not shown.
Binary file modified App/PhotoDemon/Plugins/libwebpmux.dll
Binary file not shown.
Binary file modified App/PhotoDemon/Plugins/libzstd.dll
Binary file not shown.
Binary file modified App/PhotoDemon/Plugins/pdfium.dll
Binary file not shown.
Binary file modified App/PhotoDemon/Plugins/resvg.dll
Binary file not shown.
64 changes: 32 additions & 32 deletions Modules/Plugin_CharLS.bas
Original file line number Diff line number Diff line change
Expand Up @@ -185,42 +185,42 @@ End Type

'Modern, non-deprecated APIs use decorated names. (Aliasing them here makes it much easier to sync
' against upstream vs rebasing a modified .def on each new release.)
Private Declare Function charls_get_error_message Lib "charls-2-x86" Alias "_charls_get_error_message@4" (ByVal charLSErrorNumber As CharLS_Return) As Long
'Private Declare Function charls_get_jpegls_category Lib "charls-2-x86" Alias "_charls_get_jpegls_category@0" () As Long
Private Declare Sub charls_get_version_number Lib "charls-2-x86" Alias "_charls_get_version_number@12" (ByRef vMajor As Long, ByRef vMinor As Long, ByRef vPatch As Long)
'Private Declare Function charls_get_version_string Lib "charls-2-x86" Alias "_charls_get_version_string@0" () As Long
Private Declare Function charls_get_error_message Lib "charls-2" Alias "_charls_get_error_message@4" (ByVal charLSErrorNumber As CharLS_Return) As Long
'Private Declare Function charls_get_jpegls_category Lib "charls-2" Alias "_charls_get_jpegls_category@0" () As Long
Private Declare Sub charls_get_version_number Lib "charls-2" Alias "_charls_get_version_number@12" (ByRef vMajor As Long, ByRef vMinor As Long, ByRef vPatch As Long)
'Private Declare Function charls_get_version_string Lib "charls-2" Alias "_charls_get_version_string@0" () As Long

Private Declare Function charls_jpegls_decoder_create Lib "charls-2-x86" Alias "_charls_jpegls_decoder_create@0" () As Long
Private Declare Sub charls_jpegls_decoder_destroy Lib "charls-2-x86" Alias "_charls_jpegls_decoder_destroy@4" (ByVal srcDecoder As Long)
Private Declare Function charls_jpegls_decoder_create Lib "charls-2" Alias "_charls_jpegls_decoder_create@0" () As Long
Private Declare Sub charls_jpegls_decoder_destroy Lib "charls-2" Alias "_charls_jpegls_decoder_destroy@4" (ByVal srcDecoder As Long)

Private Declare Function charls_jpegls_decoder_decode_to_buffer Lib "charls-2-x86" Alias "_charls_jpegls_decoder_decode_to_buffer@16" (ByVal srcDecoder As Long, ByVal ptrToDstBytes As Long, ByVal sizeOfDstArray As Long, ByVal dstStride As Long) As CharLS_Return
'Private Declare Function charls_jpegls_decoder_get_color_transformation Lib "charls-2-x86" Alias "_charls_jpegls_decoder_get_color_transformation@8" (ByVal srcDecoder As Long, ByRef dstColorTransform As CharLS_ColorTransformation) As CharLS_Return
Private Declare Function charls_jpegls_decoder_get_destination_size Lib "charls-2-x86" Alias "_charls_jpegls_decoder_get_destination_size@12" (ByVal srcDecoder As Long, ByVal dstStride As Long, ByRef dstSizeBytes As Long) As CharLS_Return
Private Declare Function charls_jpegls_decoder_get_frame_info Lib "charls-2-x86" Alias "_charls_jpegls_decoder_get_frame_info@8" (ByVal srcDecoder As Long, ByRef dstFrameInfo As CharLSFrameInfo) As CharLS_Return
Private Declare Function charls_jpegls_decoder_get_interleave_mode Lib "charls-2-x86" Alias "_charls_jpegls_decoder_get_interleave_mode@8" (ByVal srcDecoder As Long, ByRef dstInterleaveMode As CharLS_InterleaveMode) As CharLS_Return
'Private Declare Function charls_jpegls_decoder_get_near_lossless Lib "charls-2-x86" Alias "_charls_jpegls_decoder_get_near_lossless@12" (ByVal srcDecoder As Long, ByVal idxComponent As Long, ByRef dstNearLosslessValue As Long) As CharLS_Return
'Private Declare Function charls_jpegls_decoder_get_preset_coding_parameters Lib "charls-2-x86" Alias "_charls_jpegls_decoder_get_preset_coding_parameters@12" (ByVal srcDecoder As Long, ByVal intReserved As Long, ByVal dstCodingParameters As CharLSCodingParameters) As CharLS_Return
Private Declare Function charls_jpegls_decoder_read_header Lib "charls-2-x86" Alias "_charls_jpegls_decoder_read_header@4" (ByVal srcDecoder As Long) As CharLS_Return
Private Declare Function charls_jpegls_decoder_read_spiff_header Lib "charls-2-x86" Alias "_charls_jpegls_decoder_read_spiff_header@12" (ByVal srcDecoder As Long, ByVal ptrDstSpiffHeader As Long, ByRef dstHeaderFound As Long) As CharLS_Return
Private Declare Function charls_jpegls_decoder_set_source_buffer Lib "charls-2-x86" Alias "_charls_jpegls_decoder_set_source_buffer@12" (ByVal srcDecoder As Long, ByVal ptrToBytes As Long, ByVal srcNumBytes As Long) As CharLS_Return
Private Declare Function charls_jpegls_decoder_decode_to_buffer Lib "charls-2" Alias "_charls_jpegls_decoder_decode_to_buffer@16" (ByVal srcDecoder As Long, ByVal ptrToDstBytes As Long, ByVal sizeOfDstArray As Long, ByVal dstStride As Long) As CharLS_Return
'Private Declare Function charls_jpegls_decoder_get_color_transformation Lib "charls-2" Alias "_charls_jpegls_decoder_get_color_transformation@8" (ByVal srcDecoder As Long, ByRef dstColorTransform As CharLS_ColorTransformation) As CharLS_Return
Private Declare Function charls_jpegls_decoder_get_destination_size Lib "charls-2" Alias "_charls_jpegls_decoder_get_destination_size@12" (ByVal srcDecoder As Long, ByVal dstStride As Long, ByRef dstSizeBytes As Long) As CharLS_Return
Private Declare Function charls_jpegls_decoder_get_frame_info Lib "charls-2" Alias "_charls_jpegls_decoder_get_frame_info@8" (ByVal srcDecoder As Long, ByRef dstFrameInfo As CharLSFrameInfo) As CharLS_Return
Private Declare Function charls_jpegls_decoder_get_interleave_mode Lib "charls-2" Alias "_charls_jpegls_decoder_get_interleave_mode@8" (ByVal srcDecoder As Long, ByRef dstInterleaveMode As CharLS_InterleaveMode) As CharLS_Return
'Private Declare Function charls_jpegls_decoder_get_near_lossless Lib "charls-2" Alias "_charls_jpegls_decoder_get_near_lossless@12" (ByVal srcDecoder As Long, ByVal idxComponent As Long, ByRef dstNearLosslessValue As Long) As CharLS_Return
'Private Declare Function charls_jpegls_decoder_get_preset_coding_parameters Lib "charls-2" Alias "_charls_jpegls_decoder_get_preset_coding_parameters@12" (ByVal srcDecoder As Long, ByVal intReserved As Long, ByVal dstCodingParameters As CharLSCodingParameters) As CharLS_Return
Private Declare Function charls_jpegls_decoder_read_header Lib "charls-2" Alias "_charls_jpegls_decoder_read_header@4" (ByVal srcDecoder As Long) As CharLS_Return
Private Declare Function charls_jpegls_decoder_read_spiff_header Lib "charls-2" Alias "_charls_jpegls_decoder_read_spiff_header@12" (ByVal srcDecoder As Long, ByVal ptrDstSpiffHeader As Long, ByRef dstHeaderFound As Long) As CharLS_Return
Private Declare Function charls_jpegls_decoder_set_source_buffer Lib "charls-2" Alias "_charls_jpegls_decoder_set_source_buffer@12" (ByVal srcDecoder As Long, ByVal ptrToBytes As Long, ByVal srcNumBytes As Long) As CharLS_Return

'I have *NOT* added params for these declares, because PD currently only supports .jls reading (by design).
' If you need support for .jls writing, please file an issue on GitHub and I will translate these accordingly.
'Private Declare Function charls_jpegls_encoder_create Lib "charls-2-x86" Alias "_charls_jpegls_encoder_create@0" () As Long
'Private Declare Function charls_jpegls_encoder_destroy Lib "charls-2-x86" Alias "_charls_jpegls_encoder_destroy@4" () As Long
'Private Declare Function charls_jpegls_encoder_encode_from_buffer Lib "charls-2-x86" Alias "_charls_jpegls_encoder_encode_from_buffer@16" () As Long
'Private Declare Function charls_jpegls_encoder_get_bytes_written Lib "charls-2-x86" Alias "_charls_jpegls_encoder_get_bytes_written@8" () As Long
'Private Declare Function charls_jpegls_encoder_get_estimated_destination_size Lib "charls-2-x86" Alias "_charls_jpegls_encoder_get_estimated_destination_size@8" () As Long
'Private Declare Function charls_jpegls_encoder_rewind Lib "charls-2-x86" Alias "_charls_jpegls_encoder_rewind@4" () As Long
'Private Declare Function charls_jpegls_encoder_set_color_transformation Lib "charls-2-x86" Alias "_charls_jpegls_encoder_set_color_transformation@8" () As Long
'Private Declare Function charls_jpegls_encoder_set_destination_buffer2 Lib "charls-2-x86" Alias "_charls_jpegls_encoder_set_destination_buffer@12" () As Long
'Private Declare Function charls_jpegls_encoder_set_frame_info Lib "charls-2-x86" Alias "_charls_jpegls_encoder_set_frame_info@8" () As Long
'Private Declare Function charls_jpegls_encoder_set_interleave_mode Lib "charls-2-x86" Alias "_charls_jpegls_encoder_set_interleave_mode@8" () As Long
'Private Declare Function charls_jpegls_encoder_set_near_lossless Lib "charls-2-x86" Alias "_charls_jpegls_encoder_set_near_lossless@8" () As Long
'Private Declare Function charls_jpegls_encoder_set_preset_coding_parameters Lib "charls-2-x86" Alias "_charls_jpegls_encoder_set_preset_coding_parameters@8" () As Long
'Private Declare Function charls_jpegls_encoder_write_spiff_entry Lib "charls-2-x86" Alias "_charls_jpegls_encoder_write_spiff_entry@16" () As Long
'Private Declare Function charls_jpegls_encoder_write_spiff_header Lib "charls-2-x86" Alias "_charls_jpegls_encoder_write_spiff_header@8" () As Long
'Private Declare Function charls_jpegls_encoder_write_standard_spiff_header Lib "charls-2-x86" Alias "_charls_jpegls_encoder_write_standard_spiff_header@20" () As Long
'Private Declare Function charls_jpegls_encoder_create Lib "charls-2" Alias "_charls_jpegls_encoder_create@0" () As Long
'Private Declare Function charls_jpegls_encoder_destroy Lib "charls-2" Alias "_charls_jpegls_encoder_destroy@4" () As Long
'Private Declare Function charls_jpegls_encoder_encode_from_buffer Lib "charls-2" Alias "_charls_jpegls_encoder_encode_from_buffer@16" () As Long
'Private Declare Function charls_jpegls_encoder_get_bytes_written Lib "charls-2" Alias "_charls_jpegls_encoder_get_bytes_written@8" () As Long
'Private Declare Function charls_jpegls_encoder_get_estimated_destination_size Lib "charls-2" Alias "_charls_jpegls_encoder_get_estimated_destination_size@8" () As Long
'Private Declare Function charls_jpegls_encoder_rewind Lib "charls-2" Alias "_charls_jpegls_encoder_rewind@4" () As Long
'Private Declare Function charls_jpegls_encoder_set_color_transformation Lib "charls-2" Alias "_charls_jpegls_encoder_set_color_transformation@8" () As Long
'Private Declare Function charls_jpegls_encoder_set_destination_buffer2 Lib "charls-2" Alias "_charls_jpegls_encoder_set_destination_buffer@12" () As Long
'Private Declare Function charls_jpegls_encoder_set_frame_info Lib "charls-2" Alias "_charls_jpegls_encoder_set_frame_info@8" () As Long
'Private Declare Function charls_jpegls_encoder_set_interleave_mode Lib "charls-2" Alias "_charls_jpegls_encoder_set_interleave_mode@8" () As Long
'Private Declare Function charls_jpegls_encoder_set_near_lossless Lib "charls-2" Alias "_charls_jpegls_encoder_set_near_lossless@8" () As Long
'Private Declare Function charls_jpegls_encoder_set_preset_coding_parameters Lib "charls-2" Alias "_charls_jpegls_encoder_set_preset_coding_parameters@8" () As Long
'Private Declare Function charls_jpegls_encoder_write_spiff_entry Lib "charls-2" Alias "_charls_jpegls_encoder_write_spiff_entry@16" () As Long
'Private Declare Function charls_jpegls_encoder_write_spiff_header Lib "charls-2" Alias "_charls_jpegls_encoder_write_spiff_header@8" () As Long
'Private Declare Function charls_jpegls_encoder_write_standard_spiff_header Lib "charls-2" Alias "_charls_jpegls_encoder_write_standard_spiff_header@20" () As Long

'Library handle will be non-zero if CharLS is available; you can also forcibly override the
' "availability" state by setting m_LibAvailable to FALSE
Expand All @@ -244,7 +244,7 @@ End Function
Public Function InitializeEngine(ByRef pathToDLLFolder As String) As Boolean

Dim strLibPath As String
strLibPath = pathToDLLFolder & "charls-2-x86.dll"
strLibPath = pathToDLLFolder & "charls-2.dll"
m_LibHandle = VBHacks.LoadLib(strLibPath)
m_LibAvailable = (m_LibHandle <> 0)
InitializeEngine = m_LibAvailable
Expand Down
14 changes: 7 additions & 7 deletions Modules/Plugin_Management.bas
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ Private Const EXPECTED_EXIFTOOL_VERSION As String = "12.70"
Private Const EXPECTED_EZTWAIN_VERSION As String = "1.18.0"
Private Const EXPECTED_FREEIMAGE_VERSION As String = "3.19.0"
Private Const EXPECTED_LIBAVIF_VERSION As String = "1.0.4"
Private Const EXPECTED_LIBDEFLATE_VERSION As String = "1.19"
Private Const EXPECTED_LIBDEFLATE_VERSION As String = "1.20"
Private Const EXPECTED_LIBJXL_VERSION As String = "0.10.0"
Private Const EXPECTED_LITTLECMS_VERSION As String = "2.16.0"
Private Const EXPECTED_LZ4_VERSION As String = "10904"
Private Const EXPECTED_PDFIUM_VERSION As String = "123.0.6309"
Private Const EXPECTED_PDFIUM_VERSION As String = "126.0.6447"
Private Const EXPECTED_PSPI_VERSION As String = "0.9"
Private Const EXPECTED_RESVG_VERSION As String = "0.40.0"
Private Const EXPECTED_WEBP_VERSION As String = "1.3.2"
Private Const EXPECTED_ZSTD_VERSION As String = "10505"
Private Const EXPECTED_RESVG_VERSION As String = "0.41.0"
Private Const EXPECTED_WEBP_VERSION As String = "1.4.0"
Private Const EXPECTED_ZSTD_VERSION As String = "10506"

'To simplify handling throughout this module, plugin existence, allowance, and successful initialization are tracked internally.
' Note that not all of these specific states are retrievable externally; in general, callers should use the simplified
Expand Down Expand Up @@ -195,7 +195,7 @@ End Sub
Public Function GetPluginFilename(ByVal pluginEnumID As PD_PluginCore) As String
Select Case pluginEnumID
Case CCP_CharLS
GetPluginFilename = "charls-2-x86.dll"
GetPluginFilename = "charls-2.dll"
Case CCP_ExifTool
GetPluginFilename = "exiftool.exe"
Case CCP_EZTwain
Expand Down Expand Up @@ -333,7 +333,7 @@ Private Function GetNonEssentialPluginFiles(ByVal pluginEnumID As PD_PluginCore,
Select Case pluginEnumID

Case CCP_CharLS
dstStringStack.AddString "charls-2-x86.LICENSE.md"
dstStringStack.AddString "charls-2.LICENSE.md"

Case CCP_ExifTool
dstStringStack.AddString "exiftool-README.txt"
Expand Down
2 changes: 1 addition & 1 deletion Modules/Plugin_libdeflate.bas
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ End Sub

'libdeflate doesn't export a version function, but this class was last tested against the v1.19 release.
Public Function GetCompressorVersion() As String
GetCompressorVersion = "1.19"
GetCompressorVersion = "1.20"
End Function

Public Function CompressPtrToPtr(ByVal constDstPtr As Long, ByRef dstSizeInBytes As Long, ByVal constSrcPtr As Long, ByVal constSrcSizeInBytes As Long, Optional ByVal compressionLevel As Long = -1, Optional ByVal cmpFormat As PD_CompressionFormat = cf_Zlib) As Boolean
Expand Down
2 changes: 1 addition & 1 deletion Modules/Plugin_resvg.bas
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ Public Function GetVersion() As String
'resvg does not provide an externally accessible version string by default.
' I do not expect users to custom-build it, so we return a hard-coded version
' against the copy supplied with a default PD install.
GetVersion = "0.40.0"
GetVersion = "0.41.0"

End Function

Expand Down
2 changes: 1 addition & 1 deletion PhotoDemon.vbp
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ Description="PhotoDemon Photo Editor"
CompatibleMode="0"
MajorVer=2024
MinorVer=4
RevisionVer=4
RevisionVer=5
AutoIncrementVer=1
ServerSupportFiles=0
VersionComments="Copyright 2000-2024 Tanner Helland - photodemon.org"
Expand Down

0 comments on commit 1eddfd6

Please sign in to comment.