Recent

Author Topic: BGRA and webp  (Read 4194 times)

winni

  • Hero Member
  • *****
  • Posts: 3045
BGRA and webp
« on: October 30, 2021, 06:21:15 pm »
Hi!

Strange error message:

Code: Text  [Select][+][-]
  1. Cannot find libwebp library (libwebp.so.6)
  2.  

That's right. In my system there is libwebp.so.7 installed.

How to get around this problem?

Winni

circular

  • Hero Member
  • *****
  • Posts: 3797
    • Personal webpage
Re: BGRA and webp
« Reply #1 on: October 31, 2021, 07:25:17 am »
Normally it finds it if there is a newer version.

I suppose it is FindLinuxLibrary of linuxlib (in BGRABitmap folder) that doesn't find it for some reason.

Can you try and debug it?

It uses the bash command "ldconfig -p". What does it display for you?
Conscience is the debugger of the mind

winni

  • Hero Member
  • *****
  • Posts: 3045
Re: BGRA and webp
« Reply #2 on: October 31, 2021, 10:31:45 am »
Hi!

I get:

Code: Bash  [Select][+][-]
  1. ldconfig -p | grep webp
  2.         libwebpmux.so.3 (libc6,x86-64) => /lib64/libwebpmux.so.3
  3.         libwebpmux.so.3 (libc6) => /lib/libwebpmux.so.3
  4.         libwebpdemux.so.2 (libc6,x86-64) => /lib64/libwebpdemux.so.2
  5.         libwebp.so.7 (libc6,x86-64) => /lib64/libwebp.so.7
  6.         libwebp.so.7 (libc6) => /lib/libwebp.so.7
  7.  

System is Suse Tubleweed


Winni

PS: BGRAbitmapVersionStr is 11.3.1
« Last Edit: October 31, 2021, 10:48:17 am by winni »

winni

  • Hero Member
  • *****
  • Posts: 3045
Re: BGRA and webp
« Reply #3 on: October 31, 2021, 11:19:30 am »
Hi!

Due to the rolling release libwebp.so.7  was installed 2021-10-20
Behind the back of BGRA.

I deinstalled the BGRAbitmapPack.
And installed it again.

The error remains the same:
It is looking for libwebp.so.6 and does not find it.

Winni

circular

  • Hero Member
  • *****
  • Posts: 3797
    • Personal webpage
Re: BGRA and webp
« Reply #4 on: October 31, 2021, 05:57:14 pm »
Ok. If you put a breakpoint on line 88 of linuxlib.pas, does it get there?
Conscience is the debugger of the mind

winni

  • Hero Member
  • *****
  • Posts: 3045
Re: BGRA and webp
« Reply #5 on: October 31, 2021, 07:07:12 pm »
Hi!

No, it never reaches line 88 in linuxlib.pas

If  I do a

Code: Pascal  [Select][+][-]
  1. tmp := TBGRAbitmap.Create('/home/..../Alan-Turing.webp');
  2.  

it jumps direct to the exception.
The assembler window shows:

Code: Text  [Select][+][-]
  1. fpc_raiseexception
  2. 0000000000431F70 53                       push   %rbx
  3. 0000000000431F71 4154                     push   %r12
  4. 0000000000431F73 4155                     push   %r13
  5. .......
  6.  

It seems that the line in linuxlib is never reached.

Winni


 

winni

  • Hero Member
  • *****
  • Posts: 3045
Re: BGRA and webp
« Reply #6 on: October 31, 2021, 07:19:54 pm »
Hi!


linuxlib.pas:

Code: Pascal  [Select][+][-]
  1. RunCommand('ldconfig', ['-p'], dataText, []);
  2.  
results in an empty string dataText

Reason:

ldconfig must be run as root.
My test is run as simple user.

Winni

winni

  • Hero Member
  • *****
  • Posts: 3045
Re: BGRA and webp
« Reply #7 on: October 31, 2021, 07:32:14 pm »
Hi!

I just gave the wrong reason:

ldconfig in readonly (-p) can be  done by anyone.

BUT:

You have to give the whole path:
Code: Bash  [Select][+][-]
  1.  /usr/sbin/ldconfig  -p


Winni


PS.:  Just patched and tested: Works fine!!!
« Last Edit: October 31, 2021, 07:37:36 pm by winni »

circular

  • Hero Member
  • *****
  • Posts: 3797
    • Personal webpage
Re: BGRA and webp
« Reply #8 on: November 01, 2021, 03:06:23 am »
Oh ok cool.

I wonder though if that would always be the path to use.

I have found this suggested paths:
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

So maybe searching in those directories for ldconfig would do.
« Last Edit: November 01, 2021, 03:10:31 am by circular »
Conscience is the debugger of the mind

Fred vS

  • Hero Member
  • *****
  • Posts: 2544
    • StrumPract is the musicians best friend
Re: BGRA and webp
« Reply #9 on: November 01, 2021, 03:24:20 am »
Oh ok cool.

I wonder though if that would always be the path to use.

I have found this suggested paths:
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

So maybe searching in those directories for ldconfig would do.

Hello.

Here, on Debian 11 64 bit, it is on /usr/sbin/ldconfig and like Winni noted, the full path is needed.
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

winni

  • Hero Member
  • *****
  • Posts: 3045
Re: BGRA and webp
« Reply #10 on: November 01, 2021, 08:21:55 am »
Hi!

As root you don't need a path.

As simple user it is necessary. The error message (german)

Code: Bash  [Select][+][-]
  1. Der absolute Pfad für 'ldconfig' ist '/usr/sbin/ldconfig',
  2. daher kann das Programm möglicherweise nur von Benutzern
  3. mit Superuser-Rechten gestartet werden (z. B. root).
  4.  

Winni

circular

  • Hero Member
  • *****
  • Posts: 3797
    • Personal webpage
Re: BGRA and webp
« Reply #11 on: November 01, 2021, 11:07:26 am »
Hi! I've added on dev-bgrabitmap a function to look into the various paths.

Can you try it?
Conscience is the debugger of the mind

ADMGNS

  • New Member
  • *
  • Posts: 28
  • keep it simple and smart
Re: BGRA and webp
« Reply #12 on: November 11, 2021, 07:12:35 pm »
hello
a quick and dirty solution.. clone the library file and rename it as expected.. ;)
lucks

 

TinyPortal © 2005-2018