You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Relates to #534 . Thank you to @mizka76 for reporting this problem.
PhotoDemon can work with AVIF files, but it doesn't ship the required 3rd-party plugin (libavif) because libavif is *huge* - bigger than PhotoDemon itself! Instead, PD offers to download libavif on-the-fly when a user first interacts with an AVIF file.
This works well, but there is no additional mechanism to update libavif if the installed version falls out of date with the latest version PD supports. This commit fixes the problem with a new plugin update feature.
PD now checks plugin versions when working with AVIF files, and if it sees that the installed version is less than the latest supported version, PD will now offer to download and configure a new copy of libavif. This of course requires an internet connection, and the user can say NO to keep working with their existing plugin copy. But if they say YES, PD will download the latest libavif, decompress and install it locally (to PD), and continue with the action that initially triggered the update warning (usually loading or saving an AVIF file).
As part of this work, I also rewrote libavif's version-checking and download code to use a new generalized set of update functions. I should be able to migrate other on-demand image formats (like JPEG XL) to this same codebase, which would extend ongoing automatic updates to those formats as well.
I also updated the automatically downloaded libavif version to the latest 1.0.4 while here (previously PD used 1.0.1).
Still TODO is updating localizations for the new update feature - this will happen shortly!
If (okToDownload = vbYes) Then CheckAVIFVersionAndOfferUpdates = DownloadLatestLibAVIF()
476
+
477
+
Else
478
+
CheckAVIFVersionAndOfferUpdates = True
479
+
End If
480
+
481
+
End Function
482
+
417
483
'Notify the user that PD can automatically download and configure AVIF support for them.
418
484
'
419
485
'Returns TRUE if PD successfully downloaded (and initialized) all required plugins
@@ -458,116 +524,7 @@ Public Function PromptForLibraryDownload_AVIF(Optional ByVal targetIsImportLib A
458
524
End If
459
525
460
526
'The user said YES! Attempt to download the latest libavif release now.
461
-
Dim srcURL AsString, dstFileTemp AsString
462
-
463
-
'Before downloading anything, ensure we have write access on the plugin folder.
464
-
dstFileTemp = PluginManager.GetPluginPath()
465
-
IfNot Files.PathExists(dstFileTemp, True) Then
466
-
PDMsgBox g_Language.TranslateMessage("You have placed PhotoDemon in a restricted system folder. Because PhotoDemon does not have administrator access, it cannot download files for you. Please move PhotoDemon to an unrestricted folder and try again."), vbOKOnly Or vbApplicationModal Or vbCritical, g_Language.TranslateMessage("Error")
467
-
PromptForLibraryDownload_AVIF = False
468
-
Exit Function
469
-
End If
470
-
471
-
'Previously, PhotoDemon downloaded each .exe as-is. Now we package them into a single pdPackage file
472
-
' and extract them post-download. (This cuts download size by ~80%.)
473
-
474
-
'Grab the .pdz file. This path is hard-coded according to my most recently tested version of avifdec/enc.
0 commit comments