Skip to content

Commit

Permalink
Add support for avif images
Browse files Browse the repository at this point in the history
  • Loading branch information
BazzaCuda committed May 19, 2024
1 parent e6cd8cc commit de4079c
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
27 changes: 27 additions & 0 deletions TProgramUpdatesClass.pas
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,20 @@

interface

uses
system.zip;

type
TProgramUpdates = class(TObject)
strict private
FReleaseTag: string;
private
function getReleaseTag: string;
public
property releaseTag: string read getReleaseTag;
end;

function PU: TProgramUpdates;
function getLatestVersion: string;

implementation
Expand All @@ -44,6 +58,11 @@ TWorkProgress = class(TObject) // only because IdHttp requires these callback
gProgressBar: TProgressBar;
gDownloadForm: TDownloadForm;

function PU: TProgramUpdates;
begin
end;


function fetchURL(const aURL: string; aFileStream: TStream = NIL): string;
var
http: TidHTTP;
Expand Down Expand Up @@ -168,6 +187,14 @@ procedure TWorkProgress.idHTTPWorkBegin(aSender: TObject; aWorkMode: TWorkMode;
gProgressBar.max := aWorkCountMax;
end;

{ TProgramUpdates }

function TProgramUpdates.getReleaseTag: string;
begin
result := FReleaseTag;
case result <> '' of TRUE: EXIT; end;
end;

initialization
gLatestVersion := '';
gWP := NIL;
Expand Down
3 changes: 2 additions & 1 deletion consts.pas
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,15 @@ TMediaTypeRec = record
TFnnKeyApp = (F10_APP, F11_APP, F12_APP);

const
mediaTypes: array[0..87] of TMediaTypeRec = (
mediaTypes: array[0..88] of TMediaTypeRec = (

// manually added image formats
(mimeType: 'image/jpeg'; mediaType: mtImage; typeName: 'JPEG image'; fileExts: '.jpg.jpeg'),
(mimeType: 'image/bmp'; mediaType: mtImage; typeName: 'BITMAP image'; fileExts: '.bmp'),
(mimeType: 'image/png'; mediaType: mtImage; typeName: 'PNG image'; fileExts: '.png'),
(mimeType: 'image/webp'; mediaType: mtImage; typeName: 'WEBP image'; fileExts: '.webp'),
(mimeType: 'image/gif'; mediaType: mtImage; typeName: 'GIF image'; fileExts: '.gif'),
(mimeType: 'image/avif'; mediaType: mtImage; typeName: 'AVIF image'; fileExts: '.avif'),

// DVD/Blu-ray audio formats
(mimeType: 'audio/ac3'; mediaType: mtAudio; typeName: 'AC-3 Audio'; fileExts: '.ac3.a52'),
Expand Down

0 comments on commit de4079c

Please sign in to comment.