Recent

Author Topic: Lazarus Release 2.2.6  (Read 19943 times)

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 8895
  • Debugger - SynEdit - and more
    • wiki
Re: Lazarus Release 2.2.6
« Reply #45 on: April 09, 2023, 02:53:45 pm »
I haven't seen the particular error yet.
It would be helpful to have an example that reproduces it.

Also, test with a clean new install. Clean config, no extra packages installed or used.
For that, either:
- remove(backup) all config / since config is not cleared by the installer (not by default).
- make a 2ndary install, with it's own new config



GetMem

  • Hero Member
  • *****
  • Posts: 4074
Re: Lazarus Release 2.2.6
« Reply #46 on: April 09, 2023, 03:36:15 pm »
@SaraT
Quote
Sometimes I have to delete manually the png data image from the .dfm file to open the project :/
There are no dfm files in lazarus. Perhaps you meant lfm or are you trying to copy/pate a TImage from a delphi project?

wp

  • Hero Member
  • *****
  • Posts: 10858
Re: Lazarus Release 2.2.6
« Reply #47 on: April 09, 2023, 03:48:10 pm »
copy and paste a TImage (with png image) [...] .dfm file...
You are getting the image from Delphi? The dfm/lfm files have the name of the graphics class used to read this image at the front of the image data block (*). In case of png images, delphi uses a TPngImage while Lazarus/FPC use the TPortableNetworkGraphic class. Therefore, when you open the dfm file in Lazarus, the reader class is not detected, and Lazarus will refuse reading the file. The same happens when you install a different graphics library, such as Graphics32; their png class is named TPNG (iirc), and you will be able to open this lfm file in Lazarus only when Graphics32 is installed.

@GetMem:
Lazarus is very tolerant in opening form files, it is able to open dfm files after the resource directive has been adjusted to {$R *.dmf}

-----------------------

(*)
Here are snippets from dfm and lfm files containing a TImage with the same png picture:

Code: [Select]
dfm:
    Picture.Data = {
      0954506E67496D61676589504E470D0A1A0A0000000D49484452000000400000

lfm
    Picture.Data = {
      1754506F727461626C654E6574776F726B47726170686963D108000089504E47

To interpret these codes look at each group of 2 digits as a hex representation of a byte (char):
Code: [Select]
dfm:
  09  (length byte)
  54 = T
  50 = P
  6E = n
  67 = g
  49 = I
  6D = m
  61 = a
  67 = g
  65 = e

lfm:
  17 (length byte)
  54 = T
  50 = P
  6F = o
  72 = r
  74 = t
  61 = a
  62 = b
  6C = l
  65 = e
  etc...



« Last Edit: April 09, 2023, 04:02:36 pm by wp »

SaraT

  • Full Member
  • ***
  • Posts: 103
  • A little student
Re: Lazarus Release 2.2.6
« Reply #48 on: April 09, 2023, 04:17:34 pm »
Sorry, I wanted to say lfm files. I am not working with Delphi.

Lazarus is just installed in Windows 11. I don't have any other installation of Lazarus.

Take a look at the attached gif...
« Last Edit: April 09, 2023, 04:19:22 pm by SaraT »

wp

  • Hero Member
  • *****
  • Posts: 10858
Re: Lazarus Release 2.2.6
« Reply #49 on: April 09, 2023, 04:20:39 pm »
Repeated this with my Laz 2.2.6 on Win 11 - no problem. Still can't get the third-party graphics software idea out of my mind. Which packages, in particular packages related with graphics, are installed in your system?

SaraT

  • Full Member
  • ***
  • Posts: 103
  • A little student
Re: Lazarus Release 2.2.6
« Reply #50 on: April 09, 2023, 04:25:58 pm »
Repeated this with my Laz 2.2.6 on Win 11 - no problem. Still can't get the third-party graphics software idea out of my mind. Which packages, in particular packages related with graphics, are installed in your system?

Take a look at the attached image with all installed packages.
Im using Lazarus v2.2.6

wp

  • Hero Member
  • *****
  • Posts: 10858
Re: Lazarus Release 2.2.6
« Reply #51 on: April 09, 2023, 04:54:28 pm »
Vampyre...

I installed VampyreImaging into my Laz/main and can reproduce the issue now.

After Vampyre installation a TImage in a lfm file has this finger print:

Code: [Select]
    Picture.Data = {
      0B54496D6167696E67504E473640000089504E470D0A1A0A0000000D49484452 

This means: 54=T, 49=I 6D=m, 61=a 67=g 69=i 6E=n 67=g 50=P 4E=N 47=G ("TImagingPNG")

If you read my previous post: the LCL uses the signature "TPortableNetworkGraphic". In my test, even the IDE with Vampyre installed cannot open the such an lfm file. And since copy&paste to clipboard occurs via lfm stream it cannot read a copied TImage from the clipboard any more...

The fact that the IDE cannot read the lfm files even when Vampyre is installed should be investigated; this sounds like an issue in the streaming system.

Until this is solved: Do not install third-party graphics software which installs its own image reader/writer classes. I guess, however, that it should be possible to use Vampyre at runtime alone (without installation of the package). If, for example, you need special features of a reader of the Vampyre library you can still use the corresponding unit without installing the package:

Code: Pascal  [Select][+][-]
  1. uses
  2.   ImagingComponents;
  3.  
  4. procedure TForm1.Button1Click(Sender: TObject);
  5. var
  6.   png: TImagingPNG;
  7. begin
  8.   png := TImagingPNG.Create;
  9.   try
  10.     png.LoadFromFile('C:\Lazarus\lazarus-main_fpc3.2.2\images\general_purpose\Add_03_64.png');
  11.     Image1.Picture.Assign(png);
  12.   finally
  13.     png.Free;
  14.   end;
  15. end;
« Last Edit: April 09, 2023, 05:23:10 pm by wp »

GetMem

  • Hero Member
  • *****
  • Posts: 4074
Re: Lazarus Release 2.2.6
« Reply #52 on: April 09, 2023, 09:06:23 pm »
@wp
Interesting. This is a bug in my opinion.

Tony Stone

  • Full Member
  • ***
  • Posts: 176
Re: Lazarus Release 2.2.6
« Reply #53 on: April 23, 2023, 02:50:25 am »
THANK YOU ALL(THE DEVS ESPECIALLY) for your work on FPC and Lazarus.  That is all.  :D

omurolmez

  • New member
  • *
  • Posts: 9
Re: Lazarus Release 2.2.6
« Reply #54 on: May 09, 2023, 04:09:24 pm »
Thank you for your great effort !
Both FPC and Lazarus are amazing !

ikel

  • New Member
  • *
  • Posts: 13
Re: Lazarus Release 2.2.6
« Reply #55 on: May 12, 2023, 08:21:49 am »
The Lazarus team is glad to announce the release of Lazarus 2.2.6.
...

Thanks to the devs and testers who contributed to this release!

Sorry, I missed this announcement.

-ikel

 

TinyPortal © 2005-2018