• Welcome to Vampyre Imaging Library Forum. Please login or sign up.
 

WebP Image File Format

Started by Christian, 5 January 2020, 22:29:09

Previous topic - Next topic

Christian

Are there any plans to add support for the WebP Image File Format?

It seems as if this format is getting more and more important since it is increasingly used in websites.

Galfar

Yes, it is planned. Progress on Imaging is very slow but WebP is now one of the top priorities.

So far there is this contribution I received (attached, FPC only).

Christian

Great to hear that!

I will have a look at this contribution. Is it working for FPC or is it still in progress?

Please tell if you need some more help.

Galfar

I remember there were some linking errors but I haven't spent much time with it.
For a official WebP support in Imaging I'd go with using dynamic library.
Static linking with C object files (like here or Imaging's JPEG2000 and TIFF support) is nice that you get self-contained exe but it's a nightmare to test and maintain for all platforms.

Christian

Do you mean that you would need an external DLL file to work with WebP?

I think one of the main advantages of Imaging is that you do not need external files and you get only one exe file. That is also one of the main reasons speaking for your library. I hope you will not change that...

Galfar

I know, but with the very limited time available there's not much choice for these more complex image formats.
There used to be a way to embed DLL inside Windows EXE as a resource and use it directly from there, I'll see if it's still feasible with 64bits today. For library user that would be transparent like with C object files.

Christian

I see the time argument. Although, I would prefer waiting longer and going without the DLL solution.

There are so many libraries out there coming with DLLs and up to now Vampyre Imaging is the only with no need of a DLL so far as I know. It would be great if it stays so, also because of platform independence reasons (DLL is Windows only and any program I have written in Lazarus was compiling on Linux without any changes) and especially for little tools coming without an installer.

But of course, you are the developer, its your choice. I even cannot imagine how complex WebP is...

Luca Olivetti

Quote from: Galfar on  6 January 2020, 00:59:29Yes, it is planned. Progress on Imaging is very slow but WebP is now one of the top priorities.

So far there is this contribution I received (attached, FPC only).


I took this zip and added support for loading animated webp.
I only tested with fpc (win32 and linux 64).
Under linux I just link with the system (in my case kubuntu) provided library, under windows I used your version of libwebpwin32.a and I took libwebpdemux.a from google (version 0.6.1, since it's the same I have in kubuntu). I also changed the windows version to dynamically link msvcrt and kernel32.
Note that I also had to reverse the colors (WepPDecodeRGBAInto -> WebPDecodeBGRAInto) since the red and blue channels were swapped.

I'm attaching the patch to this message.

Luca Olivetti

15 June 2020, 16:09:09 #8 Last Edit: 15 June 2020, 18:16:05 by Galfar
Quote from: Luca Olivetti on 15 June 2020, 16:03:39I'm attaching the patch to this message.

Here it is (I hope)

Quick Reply

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Name:
Email:

Shortcuts: ALT+S save/post or ALT+P preview

SMF spam blocked by CleanTalk