Recent

Author Topic: Display webp image  (Read 430 times)

P.curtis

  • Jr. Member
  • **
  • Posts: 80
Display webp image
« on: May 26, 2020, 01:12:50 pm »
Hi All,

How can I display a webp image?

Thanks in advance.

PascalDragon

  • Hero Member
  • *****
  • Posts: 1970
  • Compiler Developer
Re: Display webp image
« Reply #1 on: May 26, 2020, 01:28:51 pm »
It seems that BGRABitmap supports WebP, so you might want to look into that direction.

TRon

  • Sr. Member
  • ****
  • Posts: 435
Re: Display webp image
« Reply #2 on: May 26, 2020, 01:34:32 pm »
Indeed bgrabitmap seems the only one to support webp images atm.

The 'usual' (implementation) route would be  https://stackoverflow.com/questions/16548725/how-do-i-display-a-webp-image-in-a-timage-or-just-tbitmap

If you want to keep it simple then use one of the many "webp to whatever format" online converting services.

wp

  • Hero Member
  • *****
  • Posts: 7401
Re: Display webp image
« Reply #3 on: May 26, 2020, 01:40:42 pm »
FreeImage (http://freeimage.sourceforge.net/download.html) is a general purpose imaging library which is able to read tons of image formats, among them also webp. I tested it with the attached demo and an image from https://developers.google.com/speed/webp/gallery1. Please note that the freeimage.dll must be present in the program folder (or in the system path).
« Last Edit: May 26, 2020, 04:52:21 pm by wp »
Mainly Lazarus trunk / fpc 3.2.0 / all 32-bit on Win-10, but many more...

trev

  • Hero Member
  • *****
  • Posts: 846
  • Former Delphi 1-7 and 10.2 User
Re: Display webp image
« Reply #4 on: May 26, 2020, 02:11:59 pm »
See the Wiki on ImageMagick which also deals with webp format images and is part of FPC.
o Lazarus v2.1.0 r63598, FPC v3.3.1 r45778, macOS 10.14.6 (with sup update), Xcode 11.3.1
o Lazarus v2.1.0 r61574, FPC v3.3.1 r42318, FreeBSD 12.1 amd64 (Parallels VM)
o FPC 3.0.4, FreeBSD 12-STABLE r361007 amd64
o Lazarus v2.1.0 r61574, FPC v3.0.4, Ubuntu 18.04 (Parallels VM)

P.curtis

  • Jr. Member
  • **
  • Posts: 80
Re: Display webp image
« Reply #5 on: May 26, 2020, 04:40:46 pm »
I went with FreeImage

 

TinyPortal © 2005-2018