Re: [Lazarus] Strange issue with TImage and lazarus 2.2.2
On Fri, 24 Jun 2022 00:05:02 +0200 Luca Olivetti via lazarus wrote: > El 23/6/22 a les 21:40, Mattias Gaertner via lazarus ha escrit: > > On Thu, 23 Jun 2022 20:38:59 +0200 > > Luca Olivetti via lazarus wrote: > > > >> [...] > >> I don't understand why the ide prefers one class over the other, I > >> guess they are all treated the same and the one registered last > >> wins? > > > > Correct. See TPicture.RegisterFileFormat > > Not that it's going to matter now that I uninstalled the package, > but why did it find the class for writing and not for reading it back? > Also, once solved that, if it streams it using a class provided by a > package, shouldn't the project have a dependency automatically added > on that package? Both should read+write valid png files, otherwise there is a bug. Are you sure, that the VampyreImaging lib is supposed to be installed in the IDE and to replace the default png TPicture? Mattias -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Strange issue with TImage and lazarus 2.2.2
El 23/6/22 a les 21:40, Mattias Gaertner via lazarus ha escrit: On Thu, 23 Jun 2022 20:38:59 +0200 Luca Olivetti via lazarus wrote: [...] I don't understand why the ide prefers one class over the other, I guess they are all treated the same and the one registered last wins? Correct. See TPicture.RegisterFileFormat Not that it's going to matter now that I uninstalled the package, but why did it find the class for writing and not for reading it back? Also, once solved that, if it streams it using a class provided by a package, shouldn't the project have a dependency automatically added on that package? Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Strange issue with TImage and lazarus 2.2.2
On Thu, 23 Jun 2022 20:38:59 +0200 Luca Olivetti via lazarus wrote: >[...] > I don't understand why the ide prefers one class over the other, I > guess they are all treated the same and the one registered last wins? Correct. See TPicture.RegisterFileFormat Mattias -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Strange issue with TImage and lazarus 2.2.2
El 23/6/22 a les 13:29, Luca Olivetti via lazarus ha escrit: I self build lazarus from the git sources, so maybe it is something in my environment. I found the cause: it's the VampyreImaging library. If I install it in the ide, it will stream png as "TImagingPNG" instead of "TPortableNetworkGraphic" but then it cannot read that format back (the method TPicture.ReadData doesn't find the corresponding class). I suppose it does the same for all other image type that the VampyreImaging library supports. I just uninstalled it from the ide and left it as a dependency for the projects where I need it (that's what I did with the previous version of lazarus, maybe I encountered the same problem and forgot about it). I don't understand why the ide prefers one class over the other, I guess they are all treated the same and the one registered last wins? Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Strange issue with TImage and lazarus 2.2.2
El 23/6/22 a les 13:29, Luca Olivetti via lazarus ha escrit: I tested under both linux(qt5) and windows and the behavior is the same (the only difference is that under windows I use fpc 3.2.0 with lazarus 2.0.12 and 3.2.2 with 2.2.2, while under windows I use fpc 3.2.2 for both). Windows 32 bits and Linux 64 bits. That doesn't make sense: under *linux* I use the same fpc for both lazarus versions. Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] Strange issue with TImage and lazarus 2.2.2
Before reporting an issue, I wanted to ask. I have a strange issue with TImage and lazarus 2.2.2: if (at designtime) I load a png or a jpg image in a TImage but at runtime it is blank. Worse, if I copy paste it, I get a streaming read error on Data (either when pasting or when running the program, the latter not always). Only .ico seems to work with lazarus 2.2.2. Now, if I open the same project in lazarus 2.0.12, the image is blank, I load a picture and it works. Then I open the modified project with lazarus 2.2.2, at designtime the image is blank, but when the program is run I can see the image I loaded with lazarus 2.0.12. I self build lazarus from the git sources, so maybe it is something in my environment. I tested under both linux(qt5) and windows and the behavior is the same (the only difference is that under windows I use fpc 3.2.0 with lazarus 2.0.12 and 3.2.2 with 2.2.2, while under windows I use fpc 3.2.2 for both). Windows 32 bits and Linux 64 bits. Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus