Lazarus

Announcements => Third party => Topic started by: BeanzMaster on June 23, 2018, 11:23:22 pm

Title: TGIFViewer component
Post by: BeanzMaster on June 23, 2018, 11:23:22 pm
Hi, to all

I'm proud to share with you my component TGIFViewer

TGIFViewer is a visual component for displaying animations at GIF (Graphic Interchange Format) with Free Pascal and Lazarus

Compatibility: Windows, Linux and MacOS

Capabilities of TGIFViewer:


Also contains 2 units:


You can download GIF-ImageTestSuite : https://github.com/jdelauney/GIF-ImageTestSuite for testing with several differently encoded GIFs

Installation:

The TGIFViewer component will be installed in the Beanz Extra section

Note:
The GifView demo application of the Demos folder does not require the installation of the component in the IDE to work.

License: MPL
© ️ 2018 J.Delauney (BeanzMaster)

Download from Github : https://github.com/jdelauney/TGIFViewer


French topic here : https://www.developpez.net/forums/d1867467/autres-langages/pascal/lazarus/annonce-composant-tgifviewer/

Best regards
Title: Re: TGIFViewer component
Post by: BeanzMaster on June 24, 2018, 04:33:53 am
Some demonstrating videos

Test under Windows 10 : https://www.youtube.com/watch?v=9KsZ70kVy4s

Test under Linux           : https://www.youtube.com/watch?v=Ci5i3o5XZdY

Test under MacOS         : https://www.youtube.com/watch?v=8f1Ft959lpk

Title: Re: TGIFViewer component
Post by: AlexTP on June 24, 2018, 09:55:56 am
I have added few issues in Github, pls see.
Title: Re: TGIFViewer component
Post by: BeanzMaster on June 24, 2018, 01:44:38 pm
Hi, Thanks Alextp for feed back. I answered to the issues ;)

I've just updated code. I've corrected some minors bugs from french user's feed back
Title: Re: TGIFViewer component
Post by: balazsszekely on June 24, 2018, 01:57:29 pm
Hi BeanzMaster,

When the component is stable enough let me know so I can add it to OPM.

PS: I ran a few test and works fine.
Title: Re: TGIFViewer component
Post by: BeanzMaster on June 24, 2018, 09:16:10 pm
New update

Following Alextp recommandation :

(see updated GIFView demo)

Translate in action: https://www.youtube.com/watch?v=tRI7Kw2RTw8

Hi BeanzMaster,

When the component is stable enough let me know so I can add it to OPM.

PS: I ran a few test and works fine.

Hi GetMem, Thanks for testing it. And thanks for add it to OPM.  It's enough stable at this stage .But Take your time and have good hollidays before   ;)

Cheers
Title: Re: TGIFViewer component
Post by: wp on June 24, 2018, 11:42:09 pm
[...] Translated internal messages thrue PO files (use a modified TGVTranslate component from Gilles Vasseurs's french tutorial : https://gilles-vasseur.developpez.com/tutoriels/lazarus-traduction/
Why do you introduce a new translation system here? Lazarus has good built-in translation support, you only must activate the i18n option and define a language folder in the package settings, as well as declare the message strings as resource strings.
Title: Re: TGIFViewer component
Post by: BeanzMaster on June 25, 2018, 12:09:28 am
Why do you introduce a new translation system here? Lazarus has good built-in translation support, you only must activate the i18n option and define a language folder in the package settings, as well as declare the message strings as resource strings.

Hi, it's not a new translation system. TGVTranslate it's just an helper. The i18n is activated but if i well understand it an application for example if i want have tanslation in french of lcl the po (lclstrconsts.fr.po in this case)  must be place in a subfolder of the application name "languages" after for loading just use
Code: Pascal  [Select][+][-]
  1. Translations.TranslateUnitResourceStrings('LCLStrConsts', LF);
where LF is the path where is po files. But perhaps i'm not understanding well on how to translate an application correctly. I like the possibility to change languages dynamically for testing. Translating french to english or vice-versa can occurs some problems in IHM due to the length of string. French sentence are often longer.

I'm open for all advices and suggestions

Notes : I've tested under Mac and  it doesn't work. I've a bug with folder settings. Don't say why. But i think i must add something in the bundle for make it work.

Title: Re: TGIFViewer component
Post by: wp on June 25, 2018, 01:15:01 am
My problem is that you seem to stuff too much unrelated material into the gifviewer package which is not absolutely needed or which could have more general use.

What do you want?

Provide a gifviewer? Then the units
- gvTranslate (similar stuff is in LCLTranslator)
- Typeshelpers (large overlap with type-helpers built into fpc now)
- and probably even uFastBitmap (because I am rather sure that you can paint the gif also with the routines of fcl-image (http://wiki.freepascal.org/fcl-image))
are not needed.

Or do you want to provide a general-purpose package with translation utils, fast bitmap, additional type helpers and - of course - gif viewer? Then you should name the package differently and emphasize its multi-use character.

A few other comments:
Please don't misunderstand these critical word - I really think your units are great work.
Title: Re: TGIFViewer component
Post by: BeanzMaster on June 25, 2018, 03:16:31 pm
Hi, wp

My problem is that you seem to stuff too much unrelated material into the gifviewer package which is not absolutely needed or which could have more general use.

What do you want?

Provide a gifviewer? Then the units
- gvTranslate (similar stuff is in LCLTranslator)
LCLTranslator have not really the same purpose. LCLTranslator need more work to be use as is and quickly
I 've include this after the suggestions by Alextp to translate franch string to english for the general community

- Typeshelpers (large overlap with type-helpers built into fpc now)
I've included it because one of tester. Use an old version of lazarus but can be easly remove by replacing "ToString"  by "IntToStr" instead, or move to the gifview demo 's folder




Or do you want to provide a general-purpose package with translation utils, fast bitmap, additional type helpers and - of course - gif viewer? Then you should name the package differently and emphasize its multi-use character.

I just want to share my work. And i'm according to you gvTranslate, and TypesHelpers not really needed here

A few other comments:
  • I see two .po files in your locale folder. Translaters don't like this. Usually they prefer a single po file per package.

I don't know that. Lazarus generate automatically One PO file for One Unit. Where i can set this option ? and how to manage it for translation ?

- and probably even uFastBitmap (because I am rather sure that you can paint the gif also with the routines of fcl-image (http://wiki.freepascal.org/fcl-image))
are not needed.
  • Did you know that, unlike Delphi, fpc already has built-in gif support (unit fpreadgif in source folder packages/fp-image/src of the fpc installation)? I did not compare, but I am rather sure that there is a lot of overlap with your unit. Why write the same again when it's already there?

Yes i say that. But FPReadGIF not take in charge animation and it's not working properly just like with the BMP format for example where many file is not support correctly. Same problem with TGA, XPM, and PCX. PNG work well, but not complete. The only format that is about to handle correctly  is JPG.
My unit haven't a  lot of overlap. But many improved on how to read and support the GIF format. You can test, you'll see with FPC's many many GIF in the Imagetestsuite cannot be read correctly with FCL-Image.

I think the FPC and LAzarus graphics solution be must be rethinking. Just see a little part in my code why i can't manage transparency correclty with TBitmap (just under linux) and must use TLazIntfImage instead ? Lazarus have bigs problems with Bitmap management. Not FCL directly, but i'm think it was not a good choice to manage color as 64 bit (TFPColor) by default. FCL-Image is not enough optimized, error management is not good, many bug are present between and with LCL RawImage/TBitmap.

 I'm according to this issue (http://michellcomputing.co.uk/blog/2016/08/free-pascal-fast-bitmap-handling-part-1/). For TFastBitmap I could have done like here http://michellcomputing.co.uk/blog/2016/08/free-pascal-fast-bitmaps-part-2/ But not really needed.
I think graphics it's an important part of developpment. And a lot of work needs to be done at this level, for be use correctly. It's too far confusing and and has too much  hidden and unexpected bugs

It's my feeling and my opinion. but I think the teams should focus on all these small details and small persistent bugs from version to version, for giving more something more stable, especially to be able to cross compile properly without having to shield the code of {$ IFDEF} on basic things (I think of the TListView for example, or like here with the use of TLazIntfImage under Linux), rather than wanting to look like Delphi. Delphi is Delphi. FPC / Lazarus is FPCC / Lazarus that's it

All of this, of course, does not detract from the quality and work of the FPC and Lazarus developers of course for giving us pleasure to code

Please don't misunderstand these critical word - I really think your units are great work.

No problem, It's with discussions like this that we can move forward

Thanks and best regards

Jérôme
Title: Re: TGIFViewer component
Post by: wp on June 25, 2018, 05:58:37 pm
LCLTranslator have not really the same purpose. LCLTranslator need more work to be use as is and quickly
As I already wrote you don't need any translation unit at all for providing multi-language support for a package. Just
- declare all string constants as resourcestring
- activate i18n in the project options
- and define a folder for the po files created by the LCL.
You do exactly this in the gifviewer unit, and this is correct.

Things are different in an application, like your demo gifview. The application must know which version of the translated po files will have to be used, and it will have to switch between translations. For this purpose, translation support units are required. The key building blocks are contained in units such as "Translations" and "LCLtranslator", but I agree that there is a need for more ready-to-use routines.

I see two .po files in your locale folder. Translaters don't like this. Usually they prefer a single po file per package.
I don't know that. Lazarus generate automatically One PO file for One Unit. Where i can set this option ? and how to manage it for translation ?
Lazarus creates a po template for each unit which contains at least one resourcestring declaration. In otder to have a single po file for the translators, you just should pack all resource strings into a single unit and "use" this in the package and in the application. The single resource string unit will correspond to a single po file. Look at Lazarus' lclstrconsts: it contains all the strings used by some unit of the LCL - this is for the LCL package. The application, Lazarus, has another translation unit, lazaruside, which collects all the strings used by the Lazarus application somewhere.

I just want to share my work.
Great!

FPReadGIF not take in charge animation
Agreed, and this is a good reason for your work.

I think the FPC and LAzarus graphics solution be must be rethinking. Just see a little part in my code why i can't manage transparency correclty with TBitmap (just under linux) and must use TLazIntfImage instead ? Lazarus have bigs problems with Bitmap management. Not FCL directly, but i'm think it was not a good choice to manage color as 64 bit (TFPColor) by default. FCL-Image is not enough optimized, error management is not good, many bug are present between and with LCL RawImage/TBitmap.
I don't agree. The FPC/Lazarus graphics units are more general than yours. Your gif viewer can only display gif images. The TImage of the LCL, on the other hand, can display any graphics format if it is registered. And FPC-Image can work with images even without the LCL. It took me quite some time until I understood this. In addition FCL-Image is rather difficult to use, and it is easy to make mistakes - therefore, it appears to be buggy. It is not, at least not more than any other software. Using FPC-Image it is possible to paint a transparent GIF for sure - transparent png is working too (all the icons of the IDE are transparent pngs). But of course, if you feel better with your fastbitmap - no problem.

You can test, you'll see with FPC's many many GIF in the Imagetestsuite cannot be read correctly with FCL-Image.
Which ImageTestSuite do you mean? I guess FPC's GIF reader does not support all features defined in the specification. The same with other formats. But usually the most important features are supported (in case of GIF, of course, except for animation).

I think the teams should focus on all these small details and small persistent bugs from version to version, for giving more something more stable, especially to be able to cross compile properly without having to shield the code of {$ IFDEF} on basic things (I think of the TListView for example, or like here with the use of TLazIntfImage under Linux), rather than wanting to look like Delphi.
I don't understand what you want to say here. As far as I know the graphics formats are not on the focus of the current development. But they are certainly maintained. So, if you find a bug please report it to bugtracker and somebody will take care of it. Also, if you find some pieces of your gif code which could be merged into the code of fpreadgif you should submit it to bugtracker.

- Typeshelpers (large overlap with type-helpers built into fpc now)
I've included it because one of tester. Use an old version of lazarus but can be easly remove by replacing "ToString"  by "IntToStr" instead, or move to the gifview demo 's folder
What would have been the problem to call "IntToStr" instead of "ToString" and adding an entire unit for it? In all the packages that I am maintaining I try to be as conservative as possible and avoid all new features in order to be able to allow old Lazarus and fpc versions.
Title: Re: TGIFViewer component
Post by: BeanzMaster on June 26, 2018, 01:05:33 am

As I already wrote you don't need any translation unit at all for providing multi-language support for a package. Just
- declare all string constants as resourcestring
- activate i18n in the project options
- and define a folder for the po files created by the LCL.
You do exactly this in the gifviewer unit, and this is correct.

Things are different in an application, like your demo gifview. The application must know which version of the translated po files will have to be used, and it will have to switch between translations. For this purpose, translation support units are required. The key building blocks are contained in units such as "Translations" and "LCLtranslator", but I agree that there is a need for more ready-to-use routines.


Ok i think it's because GifViewer demo don't use the package. the component is creating at runtime. I'll check with newer demo

Lazarus creates a po template for each unit which contains at least one resourcestring declaration. In otder to have a single po file for the translators, you just should pack all resource strings into a single unit and "use" this in the package and in the application. The single resource string unit will correspond to a single po file. Look at Lazarus' lclstrconsts: it contains all the strings used by some unit of the LCL - this is for the LCL package. The application, Lazarus, has another translation unit, lazaruside, which collects all the strings used by the Lazarus application somewhere.

Ok it's what i've supposed as process.

I don't agree. The FPC/Lazarus graphics units are more general than yours. Your gif viewer can only display gif images. The TImage of the LCL, on the other hand, can display any graphics format if it is registered. And FPC-Image can work with images even without the LCL. It took me quite some time until I understood this. In addition FCL-Image is rather difficult to use, and it is easy to make mistakes - therefore, it appears to be buggy. It is not, at least not more than any other software. Using FPC-Image it is possible to paint a transparent GIF for sure - transparent png is working too (all the icons of the IDE are transparent pngs). But of course, if you feel better with your fastbitmap - no problem.

What I mean is that FCL-Image can be coded in a much simpler, more optimized and safer way. Actually in the background the FCL is not the big problems with graphics. The bugs essentially provides from the LCL

TFastBitmap is a very very simplified class of my project. And yes i prefer use it ;) you can see some oldschool demo i've wrote with it on my Youtube channel https://www.youtube.com/channel/UCyHRNjKUCYimY0f4c7We_rA/videos .

To talk about the FCL if you want help me to understand better FCL-Image. I opened a new topic: http://forum.lazarus.freepascal.org/index.php/topic,41674.0.html

Which ImageTestSuite do you mean? I guess FPC's GIF reader does not support all features defined in the specification. The same with other formats.
But usually the most important features are supported (in case of GIF, of course, except for animation).
This GIF-ImageTestSuite : https://github.com/jdelauney/GIF-ImageTestSuite.  and for BMP https://github.com/jdelauney/BMP-ImageTestSuite

Test the images in those 2 list you'll see that many things are not supported correctly.
 
I don't understand what you want to say here. As far as I know the graphics formats are not on the focus of the current development. But they are certainly maintained. So, if you find a bug please report it to bugtracker and somebody will take care of it. Also, if you find some pieces of your gif code which could be merged into the code of fpreadgif you should submit it to bugtracker.

I'd like to use Bugtracker, but i cannot access to it, i'm always rejected on login, i'm using my e-mail and the same password, ike say login page, but not working :(. I've a bunch of bugs and suggestions

What would have been the problem to call "IntToStr" instead of "ToString" and adding an entire unit for it? In all the packages that I am maintaining I try to be as conservative as possible and avoid all new features in order to be able to allow old Lazarus and fpc versions.
No problem with that, just happy sharing ;). I'll remove it in next update

Best regards
Title: Re: TGIFViewer component
Post by: AlexTP on June 26, 2018, 08:12:31 am
You can mail me to personal-messages your patches, and I ll post them to bugtracker.
Title: Re: TGIFViewer component
Post by: BeanzMaster on June 27, 2018, 01:15:04 am
Project Updated


You can mail me to personal-messages your patches, and I ll post them to bugtracker.

Thanks i think i'll try signup with another e-mail
I'll contact you thrue PM, for help me to send a good bug report ;)
Title: Re: TGIFViewer component
Post by: wp on June 30, 2018, 01:20:32 pm
Yes. Now I definitely like it.
Title: Re: TGIFViewer component
Post by: BeanzMaster on June 30, 2018, 03:21:28 pm
Thanks wp  8-)
Title: Re: TGIFViewer component
Post by: BeanzMaster on July 04, 2018, 12:50:23 am
New Update available

Notice :
Becareful on Linux and Mac by lauching GifView inside IDE. PO files are rewritten and replaced sometimes. Don't say why.
This behaviours seems  present in Lazarus before version 1.8.4). So make a backup of the PO files before and make just a clean and build.


Best regards
Title: Re: TGIFViewer component
Post by: wp on July 05, 2018, 12:33:58 am
The BZApplicationTranslator looks interesting. A few comments, though:
Title: Re: TGIFViewer component
Post by: BeanzMaster on July 05, 2018, 02:49:13 am
Hi,
The BZApplicationTranslator looks interesting. A few comments, though:
  • I think automatically restarting the application when the language changes is not good. Are you absolutely sure that the user isn't in the process of editing something when he suddenly decides to switch language? He won't be happy that his text will be gone when the app comes back.

Yes you're right I did not think more than that. The main author of first version "gvTranslate" had done like that, I did not pay more attention.

Do you know that language can be changed by just re-translating the resource strings? In LCLTranslator this is just using another language in SetDefaultLang. Probably you have the problem that you cannot switch back to the default language because there is no correct po file for it.

No, i don't say that. Po language are generate by POEdit. The actual problem is under Lazarus when you Execute with debug. PO are regenerated.
With one the user under linux is the gifview.xxx.po. And for me under windows is the GifViewerStrConsts.xx.po. I also had the same issue under Mac.
After compiling the gifview demo if you replace po files by the original in the archive all is correct. The only thing i'v found for prevent this is to disable i18n option in the project. And finally it does not interfere with the process of translation.

Assuming that your default language is "en" just copy the "program.po" to "program.en.po". - see attached demo.[/li]

  • Multi-language does not only mean translation. You should also take care of FormatSettings. Please look at the demo in examples/translation of your Lazarus installation for some more ideas.
Thank you for your advice I'll take a look at all this. Just a question if my default language is fr it's the same, i'm right ?

Note i've updated code once more time :

Title: Re: TGIFViewer component
Post by: BeanzMaster on July 05, 2018, 03:09:05 am
Assuming that your default language is "en" just copy the "program.po" to "program.en.po". - see attached demo.[/li][/list]


I've tested and added one PO file for fr. At start IHM is in english i can change to DE or FR no problems. But I can never go back to EN. It is normal ?

An another thing,  with Lazarus when you set your language in options we need to restart Lazarus for take in charge the new language. Under Linux, windows and Mac it is mandatory. Language of the IHM is not translate automatically and dynamically.

So i think restart application is needed for translation in this case. Before restarting user must be notified and restart not will be automatic. This will be the best compromise that you think?
Title: Re: TGIFViewer component
Post by: wp on July 05, 2018, 09:03:51 am
I've tested and added one PO file for fr. At start IHM is in english i can change to DE or FR no problems. But I can never go back to EN. It is normal ?
I thought this has been fixed. Anyway: Open the .en.po file (which is a direct copy of the template .po file) in peedit - you'll see untranslated items. Go to every untranslated line and press CTRL-B to copy the original string into the translated column. Of course, both strings are the same here.
Title: Re: TGIFViewer component
Post by: wp on July 05, 2018, 10:15:15 am
if my default language is fr it's the same, i'm right ?
What exactly is "default language"? I think for the purpose of preparing multi-language applications it is the language in which you add resource strings. You seem to add resource strings in French. Therefore the template file .po contains French strings. Copy it to .fr.po and copy all untranslated strings to the translated column by pressing CTRL+B in poedit. Create an English file .en.po, have someone add the english translations, etc. So "default language" does not matter here much, except for the language file which contains the originally untranslated texts.

The next time when "default language" comes into play is when your program starts. LCLTranslator looks up in the OS and finds that your OS is in french. Therefore it picks the .fr.po file as default at start.

As for the FormatSettings, default language should not be important at all. The problem with the translation project in the Lazarus examples folder is that there does not seem to be a cross-platform way to detect the correct FormatSettings for all OSs. Therefore, the code is mostly IFDEFed with {$IFDEF Windows}
Title: Re: TGIFViewer component
Post by: BeanzMaster on July 05, 2018, 04:02:53 pm
if my default language is fr it's the same, i'm right ?
What exactly is "default language"? I think for the purpose of preparing multi-language applications it is the language in which you add resource strings. You seem to add resource strings in French. Therefore the template file .po contains French strings. Copy it to .fr.po and copy all untranslated strings to the translated column by pressing CTRL+B in poedit. Create an English file .en.po, have someone add the english translations, etc. So "default language" does not matter here much, except for the language file which contains the originally untranslated texts.

The next time when "default language" comes into play is when your program starts. LCLTranslator looks up in the OS and finds that your OS is in french. Therefore it picks the .fr.po file as default at start.

See the attached screenshots  How do you explain this ? My OS Language is French (fr) so why i can't come back to en and Why fr is not selected like you said when i'm launch the application  ?

Note I'm just do the fr.po, added header in en.po. And in radiogroup just add fr item that's it. Application was generated just by doing a "Clean and Build"

As for the FormatSettings, default language should not be important at all. The problem with the translation project in the Lazarus examples folder is that there does not seem to be a cross-platform way to detect the correct FormatSettings for all OSs. Therefore, the code is mostly IFDEFed with {$IFDEF Windows}

I know that and it's normal we must  use {$IFDEF} in this case or write special procedure for translate
Title: Re: TGIFViewer component
Post by: BeanzMaster on July 05, 2018, 04:03:29 pm
Anim of you sample
Title: Re: TGIFViewer component
Post by: wp on July 05, 2018, 04:34:33 pm
Your English translation file is empty.

Well then maybe the "default language" is English - as I said I don't know what this means here... Copy the project1.po to project1.en.po and open that in poedit. Click in every line and press CTRL+B to copy each original resource string into the translated column. Now the english po file has translations, and everything must work.

See also attached demo.
Title: Re: TGIFViewer component
Post by: BeanzMaster on July 07, 2018, 12:28:58 am
Your English translation file is empty.

Well then maybe the "default language" is English - as I said I don't know what this means here... Copy the project1.po to project1.en.po and open that in poedit. Click in every line and press CTRL+B to copy each original resource string into the translated column. Now the english po file has translations, and everything must work.

See also attached demo.

Thanks wp and sorry, i didn't understand well the first time. Now i'm ok
Title: Re: TGIFViewer component
Post by: BeanzMaster on July 07, 2018, 12:36:44 am
New update available :

Direct download : https://github.com/jdelauney/TGIFViewer/archive/master.zip (https://github.com/jdelauney/TGIFViewer/archive/master.zip)

EDIT : TGIFViewer is also available in Online Package Manager. Thank you very much GetMem  8-)
Title: Re: TGIFViewer component
Post by: BeanzMaster on November 03, 2018, 03:34:22 pm
New update available

Fix a little bug in "Application Extension" reading

Best regards
Title: Re: TGIFViewer component
Post by: Sergey Tkachenko on November 05, 2018, 02:54:15 pm
Do you plan to implement a graphic class (inherited from TGraphic)?
Title: Re: TGIFViewer component
Post by: BeanzMaster on November 05, 2018, 06:01:10 pm
Hi, Sergey

No because, animations will not be supported.
For a GIF with just a single image, it's not a problem for making loader derived from FP-Image, it's easy.
If you want to use TGraphic, actualy, from TGifViewer you can easly extract each frames to TBitmap.
For supporting animations, in all case,  i'll must do a special child of TImage, so.

In a near future, i plan to make a Delphi version for VCL and FMX.

Since severals month, i'm working on an alternative to TBitmap. It's totally independant of FPC and Lazarus. Is better,  faster, easier and more stable.
I think the bitmap managment of FPC/Lazarus need to be rewriting, because actually it'a have many things that not work correctly.

Best regards

Title: Re: TGIFViewer component
Post by: AlexTP on November 19, 2018, 11:59:51 pm
Hi, can you pls, create component for PNG Animated?
https://en.wikipedia.org/wiki/APNG
Title: Re: TGIFViewer component
Post by: HeavyUser on November 20, 2018, 06:59:48 am
Hi, can you pls, create component for PNG Animated?
https://en.wikipedia.org/wiki/APNG
https://github.com/pjde/ultibo-png
Title: Re: TGIFViewer component
Post by: AlexTP on November 20, 2018, 07:37:48 am
This link doesn't help, no component.
Title: Re: TGIFViewer component
Post by: HeavyUser on November 20, 2018, 08:07:28 am
This link doesn't help, no component.
good learn to program first
Title: Re: TGIFViewer component
Post by: BeanzMaster on November 20, 2018, 11:47:52 am
Hi, can you pls, create component for PNG Animated?
https://en.wikipedia.org/wiki/APNG
Hi Alex, yes i'll can, i not many time actually. I'll take a look, PNG and APNG is on my todo list ;)

This link doesn't help, no component.
good learn to program first

Before write a comment like this,  have you see who is Alextp ? surely not ! so please don't be so casual.

[EDIT] for informations from your "utilbo" it's don't work, don't compile anyway. Missing unit, and only support PNG but not APNG completely so....

Best regards
Title: Re: TGIFViewer component
Post by: HeavyUser on November 20, 2018, 05:58:40 pm
This link doesn't help, no component.
good learn to program first

Before write a comment like this,  have you see who is Alextp ? surely not ! so please don't be so casual.
irrelevant. Comments like "Its not a component so I can't use it" come only from laziness.

[EDIT] for informations from your "utilbo" it's don't work,
don't compile anyway. Missing unit, and only support PNG but not APNG completely so....
Not my code.
don't compile anyway. Missing unit, and only support PNG but not APNG completely so....
Good write your own. What am I your daddy to help you learn how to walk.
Title: Re: TGIFViewer component
Post by: Rusty on March 03, 2019, 01:17:28 pm
Hi BeanzMaster

Thank you for this great component. I am new to Lazarus, and have been searching for a couple of days for a way to show an animated gif.  All the other answers I found were incomplete or impossible for me to work out how to implement. Your instructions are very clear and worked first time.

One thing I found is that the gif file has to be present in the users file system. This is not a problem for me.

Cheers
Title: Re: TGIFViewer component
Post by: BeanzMaster on March 04, 2019, 04:19:54 pm
Hi BeanzMaster

Thank you for this great component. I am new to Lazarus, and have been searching for a couple of days for a way to show an animated gif.  All the other answers I found were incomplete or impossible for me to work out how to implement. Your instructions are very clear and worked first time.

Hi, Thanks.

One thing I found is that the gif file has to be present in the users file system. This is not a problem for me.

Cheers

Hum i never has this problem, i have many gif on differents folders or on usb sticks, all works

What is your OS ?

In which case it's happen exactly ?

How you use TGFiViewer (how you load the gifs ?

Cheers
Title: Re: TGIFViewer component
Post by: Rusty on March 06, 2019, 01:48:10 pm
Hi BeanzMaster

Sorry for the late reply.

I am using Win 7. When I tested the compiled application on a Win 8 machine, it produced a message saying file not found. At that time the gif was not installed on that machine.

The application is a simple form with one animated gif, specified in the TGIFViewer FileName property as C:\development\images\loading18.gif. See attached.

Cheers
Rusty
Title: Re: TGIFViewer component
Post by: lucamar on March 06, 2019, 02:18:14 pm
One thing I found is that the gif file has to be present in the users file system. This is not a problem for me.

Hum i never has this problem, i have many gif on differents folders or on usb sticks, all works

If I understand correctly, he means that the gif file must be physically present in the disk (which is quite logical) and cannot be loaded from, say, a web URL or something else.

The application is a simple form with one animated gif,  specified in the TGIFViewer FileName property as C:\development\images\loading18.gif. See attached.

If I were you, I would make the program load the image from the same folder that the program is in. That way you could just just load it in the OnCreate event by using something like:
Code: [Select]
GIFViewer.LoadFromFile(ProgramDirectory + 'myimage.gif');
Or you could add it as a resource and use LoadFromResource
Title: Re: TGIFViewer component
Post by: Rusty on March 12, 2019, 11:34:31 am
Hi BeanzMaster and lucamar

As a Newbie I didn't explain my point very well. Now I have learnt a bit more about Lazarus, I guess I meant that TGIFViewer doesn't act like TImage. I have used TImage on my form, and this appears to load its image in actual code into main.lfm , as opposed to TGIFViewer that just keeps a reference to the image in the user file system (see snapshots attached).
This is not a problem to me, (and thanks for the suggestions), it is just different.
Cheers Rusty
Title: Re: TGIFViewer component
Post by: lucamar on March 12, 2019, 01:15:35 pm
Hi BeanzMaster and lucamar

As a Newbie I didn't explain my point very well. Now I have learnt a bit more about Lazarus, I guess I meant that TGIFViewer doesn't act like TImage. I have used TImage on my form, and this appears to load its image in actual code into main.lfm , as opposed to TGIFViewer that just keeps a reference to the image in the user file system (see snapshots attached).
This is not a problem to me, (and thanks for the suggestions), it is just different.
Cheers Rusty

Oh, I see. Yes, the difference is that if you load  a picture in TImage at design-time the picture data is added to the form resource, while TGifViewer only stores the filename.
Title: Re: TGIFViewer component
Post by: BeanzMaster on March 15, 2019, 04:19:54 pm
Hi, yes TGifViewer only store the filename if you want to integrate a gif in your app create a Res file (with LazRes) and load it with LooadFromResource see the 2nd demos.

Cheers
Title: Re: TGIFViewer component
Post by: bpranoto on February 08, 2020, 04:00:00 am
There are memory leaks on this component.

I downloaded and install TGifViewer from github, run the demo with heaptrc enabled.

Attach is the memory leaks reported by Heaptrc:

Title: Re: TGIFViewer component
Post by: bpranoto on February 08, 2020, 06:15:24 am
I fixed the memory leaks.

Attached is the diff file.
Title: Re: TGIFViewer component
Post by: BeanzMaster on February 08, 2020, 10:29:25 am
Hi,
Thanks bpranoto

It's fixed the repository is uptodate

Best regards
Title: Re: TGIFViewer component
Post by: bpranoto on February 08, 2020, 03:27:07 pm
You're welcome.

Thanks for the nice component.
Title: Re: TGIFViewer component
Post by: BeanzMaster on February 08, 2020, 03:51:17 pm
Thanks for the compliment

Source is uptodate, and normally all memory leaks are fixed

Cheers
Title: Re: TGIFViewer component
Post by: bpranoto on April 23, 2021, 07:45:05 pm
Hi,

There are still memory leaks on TGifViewer.

Step to reproduce:


I have tracked all the bugs and attach the patch file to fix these bugs. Thanks
Title: Re: TGIFViewer component
Post by: BeanzMaster on April 28, 2021, 10:09:16 am
Hi, thank you very much bpranoto, i've applied your patch and updated the repository

Best regards
Title: Re: TGIFViewer component
Post by: marcov on April 28, 2021, 11:30:44 am
Did you ever started the work for the bitmap type?

I've some basic generic types that allow you to derive a 8bpp, 16bpp 24bpp and 32bpp bitmap.
Title: Re: TGIFViewer component
Post by: bpranoto on April 30, 2021, 02:26:08 pm
Hi BeanzMaster,

Thank you for the update. I really like your package for adding some funny small animations on some form which would be rather boring without

BTW, isn't it the time to update the package in OPM?

Best regards.
TinyPortal © 2005-2018