Recent

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

winni

  • Hero Member
  • *****
  • Posts: 1806
Re: New version of BGRABitmap
« Reply #510 on: November 06, 2019, 01:08:53 am »
Hi!

I think you mean efg ! He is still at work but his continuous growing website needs to be reorganized. Thats what he is doing  now. But he's is still at work since over 20 years. Yes, he was very early with cool sniplets for graphic algorithms for Delphi.

Here: http://www.efg2.com/

Winni

lainz

  • Hero Member
  • *****
  • Posts: 3704
  • Leandro Diaz
Re: New version of BGRABitmap
« Reply #511 on: November 06, 2019, 02:52:17 am »
I get it working, now is possible to load webP into BGRABitmap and save to webP from BGRABitmap on Win32, Win64
https://github.com/bgrabitmap/webp

Is missing testing it on linux and mac, but I don't know how to compile the .so files for these systems...

del

  • Full Member
  • ***
  • Posts: 185
Re: New version of BGRABitmap
« Reply #512 on: November 06, 2019, 06:13:55 am »
Hi!

I think you mean efg ! He is still at work but his continuous growing website needs to be reorganized. Thats what he is doing  now. But he's is still at work since over 20 years. Yes, he was very early with cool sniplets for graphic algorithms for Delphi.

Here: http://www.efg2.com/

Winni
That's the guy! Holy Cow have the years flown by.  :D

circular

  • Hero Member
  • *****
  • Posts: 3443
    • Personal webpage
Re: New version of BGRABitmap
« Reply #513 on: November 06, 2019, 02:55:04 pm »
I get it working, now is possible to load webP into BGRABitmap and save to webP from BGRABitmap on Win32, Win64
https://github.com/bgrabitmap/webp
Cool. I fixed a few things. I couldn't try to add the Free memory call as I can't run it on Linux. I guess on Windows, you can find a Free function for global allocation (that's not the FreeMem of Lazarus). In some places I saw they use WebPFree, though this function is not declared. Maybe it is in the Dll?

Quote
Is missing testing it on linux and mac, but I don't know how to compile the .so files for these systems...
Yes, that's a bit different. Also there is a package for webp on Linux (at least in my distro as far as I can see) so that you don't need to provide the library. But then the name of the shared library binary file may change.  %)
Conscience is the debugger of the mind

lainz

  • Hero Member
  • *****
  • Posts: 3704
  • Leandro Diaz
Re: New version of BGRABitmap
« Reply #514 on: November 06, 2019, 03:08:41 pm »
Under Ubuntu they have the version 0.6. For good the library name is duplicated, so you can put in the name libwebp.so, libwebp.so.6 and libwebp.so.6.0.2.

But it does not work... linking problem.
« Last Edit: November 06, 2019, 03:12:23 pm by lainz »

lainz

  • Hero Member
  • *****
  • Posts: 3704
  • Leandro Diaz
Re: New version of BGRABitmap
« Reply #515 on: November 06, 2019, 03:14:57 pm »
Quote
Compile Project, Mode: Debug, Target: bgrawebptest: Exit code 1, Errors: 1, Hints: 3
Hint: Start of reading config file /etc/fpc.cfg
Hint: End of reading config file /etc/fpc.cfg
Verbose: Free Pascal Compiler version 3.0.4 [2018/10/29] for x86_64
Verbose: Copyright (c) 1993-2017 by Florian Klaempfl and others
Verbose: Target OS: Linux for x86-64
Verbose: Compiling bgrawebptest.lpr
Verbose: Compiling bgrawebp.pas
bgrawebp.pas(75,3) Note: Local variable "i" not used
bgrawebptest.lpr(10,17) Unit "bgrawebp" not used in bgrawebptest
Compiling resource /home/lainz/webp/bgrawebp/lib/x86_64-linux/bgrawebptest.or
Linking /home/lainz/webp/bgrawebp/bgrawebptest
linker: /usr/bin/ld: aviso: /home/lainz/webp/bgrawebp/link.res contiene secciones de salida. ¿Olvidó -T?
linker: /usr/bin/ld: /home/lainz/webp/bgrawebp/lib/x86_64-linux/libwebp.o: en la función `VP8INITIO':
/home/lainz/webp/bgrawebp//libwebp.pas:532: referencia a `VP8InitIoInternal' sin definir

bgrawebptest.lpr(21,1) Error: Error while linking
bgrawebptest.lpr(21,1) Verbose: There were 1 errors compiling module, stopping
Verbose: Compilation aborted
Verbose: /usr/bin/ppcx64 returned an error exitcode

I'm asking in a separate thread, so others can see too
https://forum.lazarus.freepascal.org/index.php/topic,47329.0.html
« Last Edit: November 06, 2019, 03:21:41 pm by lainz »

Segator

  • Jr. Member
  • **
  • Posts: 97
    • https://github.com/Nenirey
Re: New version of BGRABitmap
« Reply #516 on: November 06, 2019, 03:25:00 pm »
the Double Commander project can read .webp files on windows and linux, is a lazarus and fpc project
i am Reinier, Nenirey and Segator :) https://github.com/Nenirey

circular

  • Hero Member
  • *****
  • Posts: 3443
    • Personal webpage
Re: New version of BGRABitmap
« Reply #517 on: November 06, 2019, 03:50:11 pm »
Hi!

I've compiled it on Linux. And it works fine!

I removed the VP8 declaration because we don't use them anyway. They do not seem to be available but that doesn't matter.

In fact you need to have libwebp-dev package installed to have the so file without version, but it is not necessary at runtime.  %)

- Fixed other few things like BGRA/RGBA order.
- Also enable it for MacOS as I suppose it works the same. Maybe you can give it a try?
Conscience is the debugger of the mind

circular

  • Hero Member
  • *****
  • Posts: 3443
    • Personal webpage
Re: New version of BGRABitmap
« Reply #518 on: November 06, 2019, 03:52:09 pm »
Hi!

I think you mean efg ! He is still at work but his continuous growing website needs to be reorganized. Thats what he is doing  now. But he's is still at work since over 20 years. Yes, he was very early with cool sniplets for graphic algorithms for Delphi.

Here: http://www.efg2.com/

Winni
That's the guy! Holy Cow have the years flown by.  :D
Oh, there seem to be interesting stuff about polygon clipping.
Conscience is the debugger of the mind

lainz

  • Hero Member
  • *****
  • Posts: 3704
  • Leandro Diaz
Re: New version of BGRABitmap
« Reply #519 on: November 06, 2019, 03:52:51 pm »
Hi. What are the steps to run it on mac os?
I need to fix my installation, just the other day updated to trunk and it stopped working...

circular

  • Hero Member
  • *****
  • Posts: 3443
    • Personal webpage
Re: New version of BGRABitmap
« Reply #520 on: November 06, 2019, 03:56:16 pm »
I thought one just needed to install libwebp-dev package, though that may not work the same on MacOS:
https://developers.google.com/speed/webp/docs/precompiled

Here they say they have statically linked the library. So maybe you just need to put the library in the same folder like on Windows.
Conscience is the debugger of the mind

circular

  • Hero Member
  • *****
  • Posts: 3443
    • Personal webpage
Re: New version of BGRABitmap
« Reply #521 on: November 06, 2019, 04:01:24 pm »
By the way, what happens if the Dll is not present when you run the application?

Also on Linux, it bothers me that one need to have the libwebp-dev package installed. I don't want users to need to download that to compile BGRABitmap.
« Last Edit: November 06, 2019, 04:05:14 pm by circular »
Conscience is the debugger of the mind

lainz

  • Hero Member
  • *****
  • Posts: 3704
  • Leandro Diaz
Re: New version of BGRABitmap
« Reply #522 on: November 06, 2019, 04:16:24 pm »
You can keep it on a helper on a separate package, so people can choose to use it or not.

I will try what happens if the DLL is not in the folder, just im not at the PC right now.

Ive downloaded the library from
https://storage.googleapis.com/downloads.webmproject.org/releases/webp/index.html

In the lib folder there is an .a file, not a .so file.
On windows happens the same, it comes with a .lib file not a .dll file, for that I needed to compile it with visual studio...

Edit> Anyways I can not build lazarus with fpcupdeluxe, it gives me an error, so for now I dont have lazarus on mac...
« Last Edit: November 06, 2019, 04:18:12 pm by lainz »

lainz

  • Hero Member
  • *****
  • Posts: 3704
  • Leandro Diaz
Re: New version of BGRABitmap
« Reply #523 on: November 06, 2019, 04:21:52 pm »
Also seems that there is a library for each Mac version too. I have 10.13 but the latest is for 10.14

circular

  • Hero Member
  • *****
  • Posts: 3443
    • Personal webpage
Re: New version of BGRABitmap
« Reply #524 on: November 06, 2019, 04:32:28 pm »
You can keep it on a helper on a separate package, so people can choose to use it or not.
Hmm yep, like the BGRAWebP unit would not be included be default.

I will rather to do a reader/writer, so that if you declare the unit, then you can load/save it using usual functions.

That can help regarding linking to the library, but that would solve the compiling thing.

I think we need to explicitely load the library with LoadLibrary to avoid linking problems at compile time.

In fact that would solve the dependency issue as well, because we can check if the library loads correctly.
Conscience is the debugger of the mind

 

TinyPortal © 2005-2018