Xfce Forum

Sub domains
 

You are not logged in.

#1 2019-03-11 16:46:57

yurbev
Member
Registered: 2016-04-18
Posts: 54

Theories on No Incorporation of Webp and BPG into Linux OSes?

I scratch my head about this, wondering why BPG (Better Portable Graphics) and Webp support isn't standard in all Linux installations, as is JPG. BPG and Webp have been around for at least 5 years and are superior to JPG, in that I see no loss of quality in conversion to these two formats from JPG, and significantly smaller filesizes. I'd think XFCE and Imagemagick would have these formats in the default installations by now, but instead when I've tried making the two formats work in the past I had to jump through lots of hoops to get them installed, and those steps may no longer work now that I'm using newer systems.

Offline

#2 2019-03-11 23:05:17

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: Theories on No Incorporation of Webp and BPG into Linux OSes?

In what way are you suggesting that Xfce support them? Tumbler?


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2019-03-11 23:58:44

yurbev
Member
Registered: 2016-04-18
Posts: 54

Re: Theories on No Incorporation of Webp and BPG into Linux OSes?

I'd think they would come default in any Linux program dealing with images . . . file browsers (for thumbnails, do I guess tumbler), ImageMagick, image viewers such as XNViewMP. When I search for bpg in relation to Linux in Google I don't get many hits. It doesn't appear hardly any Linux users have any interest in these two superior formats. BPG animation, for example, can cut down the size of a gif animation by 90%. Just doesn't make sense to me that I need to jump through lots of hoops to use these two formats in Linux, particularly BPG.

Last edited by yurbev (2019-03-12 00:00:03)

Offline

#4 2019-03-12 01:12:08

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: Theories on No Incorporation of Webp and BPG into Linux OSes?

I won't comment on Linux support in general - you probably need to discuss this your distro provider. However, as of version 0.2.0, tumbler now supports custom thumbnailers again.

Try these (works for me in Arch and tumbler 0.2.x):

BPG
To get bpg support in linux, install the libbpg package. This will give you:

  1. bpenc = a bpgencoder

  2. bpgdec = a bpg decoder

  3. bpgview = a bpgviewer

Imagemagik will then support the file format.

To get tumbler to support it (requires tumbler 0.2.x), create the file /usr/share/thumbnailers/bpg.thumbnailer with the following content:

[Thumbnailer Entry]
Version=1.0
Encoding=UTF-8
Type=X-Thumbnailer
Name=bpg Thumbnailer
MimeType=image/x-bpg;
Exec=/usr/bin/convert -thumbnail %s %i %o

...and if the image/x-bpg mime type is not currently known on your system (see: xfce4-mime-settings), then create ~/.local/share/mime/packages/bpg.xml with the following content:

<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
    <mime-type type="image/x-bpg">
        <comment>dds file</comment>
        <icon name="image"/>
        <glob-deleteall/>
        <glob pattern="*.bpg"/>
    </mime-type>
</mime-info>

...and run:

update-mime-database ~/.local/share/mime

WEBP
To get webp support in linux, install libwebp package. This will give you:

  1. cwebp = a conversion utility to webp

  2. dwebp = a conversion utility from webp

  3. vwebp = a webp viewer

  4. plus others.

To get tumbler to support it (requires tumbler 0.2.x), create the file /usr/share/thumbnailers/webp.thumbnailer with the following content:

[Thumbnailer Entry]
Version=1.0
Encoding=UTF-8
Type=X-Thumbnailer
Name=webp Thumbnailer
MimeType=image/webp;
Exec=/usr/bin/convert -thumbnail %s %i %o

...and if the image/webp file mime type is not currently known on your system (see: xfce4-mime-settings), then create ~/.local/share/mime/packages/webp.xml with the following content:

<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
    <mime-type type="image/webp">
        <comment>dds file</comment>
        <icon name="image"/>
        <glob-deleteall/>
        <glob pattern="*.webp"/>
    </mime-type>
</mime-info>

...and run:

update-mime-database ~/.local/share/mime

Log out and back in again to see the thumbnails in thunar and on your desktop.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#5 2019-03-12 16:54:58

yurbev
Member
Registered: 2016-04-18
Posts: 54

Re: Theories on No Incorporation of Webp and BPG into Linux OSes?

Thank you for the tutorial. I wasn't thinking of trying to install them, but now I'll try. I have Tumbler 0.2.1 on Linux Mint XFCE 19.1 64-bit.

I followed all your steps for installing webp, but the webp thumbnail doesn't work in Thunar. I logged out and in, and then restarted. Perhaps I installed the wrong webp package? I installed from synaptic. Here's the info:

libwebkit2gtk-4.0-37/bionic-updates,bionic-security,now 2.22.6-0ubuntu0.18.04.1 amd64 [installed]
libwebkitgtk-3.0-0/bionic,now 2.4.11-3ubuntu3 amd64 [installed]
libwebp-dev/bionic,now 0.6.1-2 amd64 [installed]
libwebp6/bionic,now 0.6.1-2 amd64 [installed]
libwebpdemux2/bionic,now 0.6.1-2 amd64 [installed]
libwebpmux3/bionic,now 0.6.1-2 amd64 [installed]

With BPG I'm stuck at trying to install libbpg-0.9.8. I get an error after running make:

make
gcc -Os -Wall -MMD -fno-asynchronous-unwind-tables -fdata-sections -ffunction-sections -fno-math-errno -fno-signed-zeros -fno-tree-vectorize -fomit-frame-pointer -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_REENTRANT -I. -DCONFIG_BPG_VERSION=\"0.9.8\" -g -c -o bpgdec.o bpgdec.c
bpgdec.c:25:10: fatal error: stdlib.h: No such file or directory
 #include <stdlib.h>
          ^~~~~~~~~~
compilation terminated.
Makefile:228: recipe for target 'bpgdec.o' failed
make: *** [bpgdec.o] Error 1

Last edited by yurbev (2019-03-12 17:12:26)

Offline

#6 2019-03-12 20:26:52

Skaperen
Member
From: right by Jesus, our Saviour
Registered: 2013-06-15
Posts: 812

Re: Theories on No Incorporation of Webp and BPG into Linux OSes?

there are patent issues for BPG, the same patents for HEVC.  this won't prevent you from installing libbpg but because it will affect some things, it will not come into widespread use until after all the patents in all countries expire.

Offline

#7 2019-03-12 23:10:20

yurbev
Member
Registered: 2016-04-18
Posts: 54

Re: Theories on No Incorporation of Webp and BPG into Linux OSes?

Skaperen wrote:

there are patent issues for BPG, the same patents for HEVC.  this won't prevent you from installing libbpg but because it will affect some things, it will not come into widespread use until after all the patents in all countries expire.

Ah that makes sense.

XNView has plugins for it.

Offline

#8 2019-03-12 23:30:38

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: Theories on No Incorporation of Webp and BPG into Linux OSes?

@yurbev,
For webp, make sure you install the webp package:

sudo apt-get install webp

Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#9 2019-03-12 23:42:58

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: Theories on No Incorporation of Webp and BPG into Linux OSes?

To get bpg compiled, here are the instructions that I followed:

sudo apt-get install build-essential libpng-dev libjpeg-dev cmake libsdl2-image-2.0-0 libsdl2-image-dev yasm libsdl-image1.2-dev
wget https://bellard.org/bpg/libbpg-0.9.8.tar.gz
tar xzvf libbpg-0.9.8.tar.gz
cd libbpg-0.9.8
sed -i 's/$(CMAKE_OPTS)/$(CMAKE_OPTS) -DENABLE_LIBNUMA=OFF/' Makefile
sed -i 's/^CFLAGS+=-I.$/CFLAGS+=-I. -fPIC/' Makefile
make
sudo make install

Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#10 2019-03-13 00:26:59

yurbev
Member
Registered: 2016-04-18
Posts: 54

Re: Theories on No Incorporation of Webp and BPG into Linux OSes?

Fantastic! They're both working now. FYI there should be a hyphen in

libsdl-image1.2dev

What do you use for viewing BPG images? The native viewer that's packaged with it? I'll take a crack at installing the BPG plugin for XNViewMP.

Last edited by yurbev (2019-03-13 00:27:14)

Offline

#11 2019-03-13 01:14:17

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: Theories on No Incorporation of Webp and BPG into Linux OSes?

yurbev wrote:

Fantastic! They're both working now. FYI there should be a hyphen in

libsdl-image1.2dev

Thanks. I fixed my post.

What do you use for viewing BPG images? The native viewer that's packaged with it? I'll take a crack at installing the BPG plugin for XNViewMP.

Thunar with zoom set to max? smile
The built-in viewer seems to work fine for me.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#12 2021-03-16 10:38:39

WolfBullet
Member
Registered: 2021-03-16
Posts: 1

Re: Theories on No Incorporation of Webp and BPG into Linux OSes?

ToZ wrote:

To get bpg compiled, here are the instructions that I followed:

sudo apt-get install build-essential libpng-dev libjpeg-dev cmake libsdl2-image-2.0-0 libsdl2-image-dev yasm libsdl-image1.2-dev
wget https://bellard.org/bpg/libbpg-0.9.8.tar.gz
tar xzvf libbpg-0.9.8.tar.gz
cd libbpg-0.9.8
sed -i 's/$(CMAKE_OPTS)/$(CMAKE_OPTS) -DENABLE_LIBNUMA=OFF/' Makefile
sed -i 's/^CFLAGS+=-I.$/CFLAGS+=-I. -fPIC/' Makefile
make
sudo make install

I used your method but I'm still receiving the Makefile:228: recipe for target 'bpgenc.o' failed error and this is the only thing I found on it. I'm in  a docker container with the nvidia/cuda:9.0-runtime-ubuntu16.04 image. I need it for imagemagick to let it work with the bpg files and I want to make opencl work with gpu's. So do you maybe know why I'm still receiving this error even after your steps? This is the error I received.

bpgenc.c: In function 'read_png':
bpgenc.c:995:9: warning: implicit declaration of function 'png_set_alpha_mode' [-Wimplicit-function-declaration]
         png_set_alpha_mode(png_ptr, PNG_ALPHA_ASSOCIATED, PNG_GAMMA_LINEAR);
         ^
bpgenc.c:995:37: error: 'PNG_ALPHA_ASSOCIATED' undeclared (first use in this function)
         png_set_alpha_mode(png_ptr, PNG_ALPHA_ASSOCIATED, PNG_GAMMA_LINEAR);
                                     ^
bpgenc.c:995:37: note: each undeclared identifier is reported only once for each function it appears in
bpgenc.c:995:59: error: 'PNG_GAMMA_LINEAR' undeclared (first use in this function)
         png_set_alpha_mode(png_ptr, PNG_ALPHA_ASSOCIATED, PNG_GAMMA_LINEAR);
                                                           ^
bpgenc.c:1080:45: warning: passing argument 5 of 'png_get_iCCP' from incompatible pointer type [-Wincompatible-pointer-types]
                          &name, &comp_type, &iccp_buf, &iccp_buf_len) ==
                                             ^
In file included from /usr/include/png.h:321:0,
                 from bpgenc.c:32:
/usr/include/png.h:2229:8: note: expected 'png_charpp {aka char **}' but argument is of type 'png_byte ** {aka unsigned char **}'
 extern PNG_EXPORT(png_uint_32,png_get_iCCP) PNGARG((png_structp png_ptr,
        ^
Makefile:228: recipe for target 'bpgenc.o' failed

Last edited by WolfBullet (2021-03-16 11:28:23)

Offline

#13 2021-03-16 11:54:31

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: Theories on No Incorporation of Webp and BPG into Linux OSes?

WolfBullet wrote:

I used your method but I'm still receiving the Makefile:228: recipe for target 'bpgenc.o' failed error and this is the only thing I found on it.

Use libpng16-dev instead of libpng12-dev. The instructions posted ask for libpng-dev but that package doesn't exist in xenial. You must have installed libpng12-dev instead.

I'm in  a docker container with the nvidia/cuda:9.0-runtime-ubuntu16.04 image.

There is only a month and a half of support left for xenial - if you haven't already, you should start considering an upgrade path.

EDIT: You are going to run into other issues later. In Xenial, libsdl-image1.2-dev depends on libpng12-dev but you need libpng16-dev. You can't have both installed at the same time. It doesn't look like you can build this in Xenial.

Last edited by ToZ (2021-03-16 12:06:20)


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

Board footer

Powered by FluxBB