Recent

Author Topic: New version of BGRABitmap  (Read 316372 times)

circular

  • Hero Member
  • *****
  • Posts: 4443
    • Personal webpage
Re: New version of BGRABitmap
« Reply #750 on: May 25, 2025, 04:18:13 pm »
BGRABitmap version 11.6.6 compiles without problems in Lazarus trunk (4.99) and FPC 3.2-fixes.
So setting dependencies on the compiler itself will break other configurations. I think you would need to set a dependency on both Lazarus and FPC versions
Yes paweld, with version value 3.2, the directive would redefine the functions.

Strange I tested the dev branch with 4.0rc2 and it compiled...
Yes lainz, I presume this would as well be FPC 3.2, because it is distributed with Lazarus 4.0.

Hum, here, with last commits from fixes_3_2 I get that TPointF  error.
And the patch {$if FPC_FULLVERSION <= 30203} did not help.
Fred vS, it seems you're rather having a problem with RectF function in LazPaint code. Or do you really mean you're getting the exact same error message as timppl?

Regarding the error
Quote
lazpaint/ugraph.pas(1209,20) Error: (3026) Wrong number of parameters specified for  call to "RectF"

Found declaration: RectF(Single;Single;Single;Single):<record type>;

Does it solve the problem to prefix, on line 1208 of ugraph.pas, RectF function with "BGRABitmapTypes." like this?
Code: Pascal  [Select][+][-]
  1.   for pt in APoints do
  2.     rF := rF.Union(BGRABitmapTypes.RectF(pt + PointF(0.5, 0.5) - PointF(w, w),
  3.       pt + PointF(0.5, 0.5) + PointF(w, w)));

Quote
Of couuuurse, it is a bad workaround but it is nice that only this code has problems.
Well it's good to know the scope of the compile error.  :)
Conscience is the debugger of the mind

paweld

  • Hero Member
  • *****
  • Posts: 1429
Re: New version of BGRABitmap
« Reply #751 on: May 25, 2025, 04:18:32 pm »
@Fred vS: Yes, only the error is related to LazPaint and not the BGRABitamp package.
And the solution is simpler - indicate the unit from which it should retrieve the function:
Code: Pascal  [Select][+][-]
  1.   for pt in APoints do
  2.     rF := rF.Union(BGRABitmapTypes.RectF(pt + PointF(0.5, 0.5) - PointF(w, w),
  3.       pt + PointF(0.5, 0.5) + PointF(w, w)));    
As for the component, it also compiles without problems in Lazarus 4 and FPC 3.2-fixes.
Best regards / Pozdrawiam
paweld

Fred vS

  • Hero Member
  • *****
  • Posts: 3628
    • StrumPract is the musicians best friend
Re: New version of BGRABitmap
« Reply #752 on: May 25, 2025, 04:30:25 pm »

Does it solve the problem to prefix, on line 1208 of ugraph.pas, RectF function with "BGRABitmapTypes." like this?
Code: Pascal  [Select][+][-]
  1.   for pt in APoints do
  2.     rF := rF.Union(BGRABitmapTypes.RectF(pt + PointF(0.5, 0.5) - PointF(w, w),
  3.       pt + PointF(0.5, 0.5) + PointF(w, w)));


Yep well seen!  ;D

With this, LazPaint + fpc 3.2.3 compiles + runs out of the box.

Well seen to Paweld too.  ;)
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

circular

  • Hero Member
  • *****
  • Posts: 4443
    • Personal webpage
Re: New version of BGRABitmap
« Reply #753 on: May 25, 2025, 06:18:06 pm »
Ok, I've applied this change on dev-lazpaint.

Fred vS, regarding the change in the compile directive, I presume that your answer points to the fact it it works well with FPC 3.2.3, is that correct?

Waiting a bit to see if timppl confirms.
Conscience is the debugger of the mind

Fred vS

  • Hero Member
  • *****
  • Posts: 3628
    • StrumPract is the musicians best friend
Re: New version of BGRABitmap
« Reply #754 on: May 25, 2025, 08:06:07 pm »
Fred vS, regarding the change in the compile directive, I presume that your answer points to the fact it it works well with FPC 3.2.3, is that correct?

Yes, compiling lazpaint with the change in the compile directive and using last commit from https://gitlab.com/freepascal.org/fpc/source/-/commits/fixes_3_2 is ok, on Linux and FreeBSD.

And it is ok also with fpc 3.2.2 (retested now).
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

circular

  • Hero Member
  • *****
  • Posts: 4443
    • Personal webpage
Re: New version of BGRABitmap
« Reply #755 on: May 25, 2025, 08:26:39 pm »
Great! Here is the change on dev-bgrabitmap: https://github.com/bgrabitmap/bgrabitmap/pull/292

Thanks everybody :)

timppl, the change is not released yet. If you have any question on how to get the dev version or apply the changes locally, we're here to help.
Conscience is the debugger of the mind

timppl

  • Jr. Member
  • **
  • Posts: 86
Re: New version of BGRABitmap
« Reply #756 on: May 26, 2025, 12:00:07 pm »
Hi all

I have done a git clone of the latest, but I still cannot get it to compile. I have tried with Lazarus 3.8, 4.1 and trunk.

Most of the errors have gone, the only ones that remain are the following:

Quote
bgradefaultbitmap.pas
      {$IF FPC_FULLVERSION>=30203}
      //Resolution
      ResolutionUnit:=TFPCustomImage(Source).ResolutionUnit;
      ResolutionX:=TFPCustomImage(Source).ResolutionX;
      ResolutionY:=TFPCustomImage(Source).ResolutionY;
      {$ENDIF}

unibitmap.inc
      {$IF FPC_FULLVERSION>=30203}
      //Resolution
      ResolutionUnit:=TFPCustomImage(Source).ResolutionUnit;
      ResolutionX:=TFPCustomImage(Source).ResolutionX;
      ResolutionY:=TFPCustomImage(Source).ResolutionY;
      {$ENDIF}

Commenting out these lines lets it compile. If I leave them in then the compilation fails because TFPCustomImage does not have any of the properties referred to.

HTH

Tim 
Mageia 9 Linux on x86_64

circular

  • Hero Member
  • *****
  • Posts: 4443
    • Personal webpage
Re: New version of BGRABitmap
« Reply #757 on: May 26, 2025, 03:19:13 pm »
Hi timppl,

Thanks for your feedback, it does help.

The issue seems more understanble to me now: compiler directives relative to FPC 3.2.3 basically need to consider 3.2.3 to be the same as 3.2.2, because changes visible to user code are only in version 3.2.4 or more.

I've changed numerous compiler directives according to this, so no need to comment any code anymore. I invite you to check again if that works fine for you.

If someone is on trunk, I would be reassured to have the confirmation that it stills compiles nicely there.

Regards
Conscience is the debugger of the mind

paweld

  • Hero Member
  • *****
  • Posts: 1429
Re: New version of BGRABitmap
« Reply #758 on: May 27, 2025, 10:01:33 am »
@circular: fpc 3.2-fixes (3.2.3) it is certainly not compatible with 3.2.2. Your recent changes broke the component and now it does not compile - the reason:
Code: [Select]
unibitmap.inc(123,5) Error: Duplicate identifier "FResolutionUnit"
unibitmap.inc(124,5) Error: Duplicate identifier "FResolutionX"
C:\_dev\laz_test4\___components\bgrabitmap\bgrabitmap\unibitmap.inc
keep in mind that 3.2-fixes is not frozen and changes have been added to it for about 5 years, so always check on the most recent version, not, for example, from 4 years ago.
Best regards / Pozdrawiam
paweld

circular

  • Hero Member
  • *****
  • Posts: 4443
    • Personal webpage
Re: New version of BGRABitmap
« Reply #759 on: May 27, 2025, 01:15:55 pm »
Oh wow, so ResolutionUnit:
And both are identified as FPC 3.2.3. So it is not possible to differentiate them with the compiler directive, right?

Now I wonder, timppl, how do you get FPC 3.2.3? Are you using the tag 3.2.3? Maybe the solution would be for you to use either the regular FPC 3.2.2 or the branch fixes_3_2 ?

And then I could just revert the changes I've made and presume users will not use tag 3.2.3.
Conscience is the debugger of the mind

paweld

  • Hero Member
  • *****
  • Posts: 1429
Re: New version of BGRABitmap
« Reply #760 on: May 27, 2025, 01:34:37 pm »
Yes, 3.2-fixes = 3.2.3, but as you can see in the commit history the tag has not been updated for 4 years.
Generally when installing lazarus / fpc using fpcupdeluxe you should choose between:
- main (trunk) - the latest development version, to which all changes go
- fixes - the latest stable version with fixes released since the stable version was published
- stable - the latest stable version
- specific version number, but remember that the last digit of version number should be even - meaning that it was a stable version.

Any other tag I recommend omitting.
Best regards / Pozdrawiam
paweld

timppl

  • Jr. Member
  • **
  • Posts: 86
Re: New version of BGRABitmap
« Reply #761 on: May 31, 2025, 10:09:06 am »
Hello circular

To be honest I can't remember where I got 3.2.3 from, I downloaded it from a link somewhere on this forum to somewhere on to my previous laptop and copied it to the new one  :).

I tried to use 3.2.2 and to build fixes_3.2 but both have the dreaded
Quote
__libc_csu_init
missing problem ( this was both on debian and on Mageia).

HTH

Tim
Mageia 9 Linux on x86_64

circular

  • Hero Member
  • *****
  • Posts: 4443
    • Personal webpage
Re: New version of BGRABitmap
« Reply #762 on: June 01, 2025, 11:51:28 am »
Hi tmppl,

Ok, so you're getting a compilation error with 3.2.2 and fixes3_2 related to __libc_csu_init.

So I've reverted the changes I had made on dev, because these branches are nevertheless the current ones. To help you, maybe I could introduce a directive like FPIMAGE_HAS_RESOLUTION so that it could be tweaked, and let the code depend on it.
 
I presume you've already looked up for help regarding __libc_csu_init problem?
Conscience is the debugger of the mind

 

TinyPortal © 2005-2018