Git Product home page Git Product logo

Comments (6)

lainz avatar lainz commented on July 22, 2024

Hi. Older version of fpc may not have all features required by the newest version. Also bgrabitmap depends on LCL that's also moving.

Try checking what was the release date of that Lazarus version and try downloading an old version of bgrabitmap and bgracontrols.

from bgracontrols.

circular17 avatar circular17 commented on July 22, 2024

Hmmm maybe it can be made compatible with Lazarus 2.0.8 that uses FPC 3.0.4 which already has generics. In the avifbgra unit, a new inline syntax for specialized is used, but we can do without it.

@tcsorgo
Can you try and replace the factory functions in the avifbgra unit with the following:

function TAvifImageFactory(aImagePtr: Pointer): TAvifImageBase;
type
  TAvigImage0_11_0 = specialize TAvifImage<PavifImage0_11_0>;
  TAvigImage0_8_4 = specialize TAvifImage<PavifImage0_8_4>;
begin
  if AVIF_VERSION >= AVIF_VERSION_0_11_0 then
    Result := TAvigImage0_11_0.Create(aImagePtr)
  else
    Result := TAvigImage0_8_4.Create(aImagePtr);
end;

function TDecoderFactory(aDecoderPtr: Pointer): TDecoderBase;
type
  TDecoder0_11_0 = specialize TDecoder<PAvifDecoder0_11_0>;
  TDecoder0_10_0 = specialize TDecoder<PAvifDecoder0_10_0>;
  TDecoder0_9_3 = specialize TDecoder<PAvifDecoder0_9_3>;
  TDecoder0_9_2 = specialize TDecoder<PAvifDecoder0_9_2>;
  TDecoder0_8_4 = specialize TDecoder<PAvifDecoder0_8_4>;
begin
  if AVIF_VERSION >= AVIF_VERSION_0_11_0 then
     result := TDecoder0_11_0.Create(aDecoderPtr)
  else if AVIF_VERSION >= AVIF_VERSION_0_10_0 then
     result := TDecoder0_10_0.Create(aDecoderPtr)
  else if AVIF_VERSION >= AVIF_VERSION_0_9_3 then
     result := TDecoder0_9_3.Create(aDecoderPtr)
  else if AVIF_VERSION >= AVIF_VERSION_0_9_2 then
     result := TDecoder0_9_2.Create(aDecoderPtr)
  else
     result := TDecoder0_8_4.Create(aDecoderPtr);
end;

function TEncoderFactory(aEncoderPtr: Pointer): TEncoderBase;
type
  TEncoder0_11_0 = specialize TEncoder<PAvifEncoder0_11_0>;
  TEncoderBefore = specialize TEncoder<PAvifEncoder>;
begin
  if AVIF_VERSION >= AVIF_VERSION_0_11_0 then
    result:=TEncoder0_11_0.Create(aEncoderPtr)
  else
    result:=TEncoderBefore.Create(aEncoderPtr);
end;

function TAvifRGBImageFactory(): TAvifRGBImageBase;
type
  TAvifRGBImage0_11_0 = specialize TAvifRGBImage<PavifRGBImage0_11_0>;
  TAvifRGBImage0_10_0 = specialize TAvifRGBImage<PavifRGBImage0_10_0>;
  TAvifRGBImage0_8_4 =  specialize TAvifRGBImage<PavifRGBImage0_8_4>;
begin
  if AVIF_VERSION >= AVIF_VERSION_0_11_0 then
    result:=TAvifRGBImage0_11_0.Create
  else if AVIF_VERSION >= AVIF_VERSION_0_10_0 then
    result:=TAvifRGBImage0_10_0.Create
  else
    result:=TAvifRGBImage0_8_4.Create;
end; 

from bgracontrols.

tcsorgo avatar tcsorgo commented on July 22, 2024

@circular17
I have made your proposal changing these functions.
Now I get new errors pointing to other functions.

This type of functions are concerned:
function TDecoder.GetImage:PavifImage;
begin
result := FDecoder^.image;
end;

Errors:
Csomag fordítása: BGRABitmapPack 11.5.3: Kilépési kód: 1, Hibák: 26
avifbgra.pas(231,22) Error: Illegal qualifier
avifbgra.pas(236,22) Error: Illegal qualifier
avifbgra.pas(257,20) Error: Illegal qualifier
avifbgra.pas(262,20) Error: Illegal qualifier
avifbgra.pas(267,10) Error: Illegal qualifier
avifbgra.pas(272,10) Error: Illegal qualifier
avifbgra.pas(277,10) Error: Illegal qualifier
avifbgra.pas(282,10) Error: Illegal qualifier
avifbgra.pas(287,10) Error: Illegal qualifier
avifbgra.pas(292,10) Error: Illegal qualifier
avifbgra.pas(297,10) Error: Illegal qualifier
avifbgra.pas(312,12) Error: Illegal qualifier
avifbgra.pas(317,12) Error: Illegal qualifier
avifbgra.pas(322,12) Error: Illegal qualifier
avifbgra.pas(327,12) Error: Illegal qualifier
avifbgra.pas(332,12) Error: Illegal qualifier
avifbgra.pas(337,12) Error: Illegal qualifier
avifbgra.pas(342,12) Error: Illegal qualifier
avifbgra.pas(357,20) Error: Illegal qualifier
avifbgra.pas(362,20) Error: Illegal qualifier
avifbgra.pas(367,10) Error: Illegal qualifier
avifbgra.pas(372,10) Error: Illegal qualifier
avifbgra.pas(377,10) Error: Illegal qualifier
avifbgra.pas(382,10) Error: Illegal qualifier
avifbgra.pas(387,10) Error: Illegal qualifier
avifbgra.pas(392,10) Error: Illegal qualifier

from bgracontrols.

circular17 avatar circular17 commented on July 22, 2024

Hmmm I don't see an easy fix for this one.

I suppose the simplest would be to remove the following units from the package: avifbgra, BGRAReadAvif and BGRAWriteAvif (in the package window of BGRABitmapPack).

Then remove the reference to BGRAReadAvif and BGRAWriteAvif in the uses clause in BGRABitmap unit (line 196 of bgrabitmap.pas).

Does it solve the problem?

from bgracontrols.

lainz avatar lainz commented on July 22, 2024

Hi. I've notified in the OPM thread that the information should be updated about the compatibility and they did it. It needs a more recent version of FPC

from bgracontrols.

circular17 avatar circular17 commented on July 22, 2024

Ok thanks

from bgracontrols.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.