! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Ristretto is not color managed
Status:
RESOLVED: MOVED
Priority:
Very Low
Severity:
enhancement
Product:
Ristretto
Component:
Application

Comments

Description Andreas Siegert 2011-10-16 08:38:25 CEST
Ristretto is the default XFCE image viewer, but is incapable of displaying images correctly on modern wide gamut screens or when images are not in sRGB.

See http://en.wikipedia.org/wiki/Color_management

Trying to display this properly in Ristretto: http://img.fotocommunity.com/photos/4763821.jpg
(Gelb should be yellow, Grün should be green, Blau should be blue, Purpur should be purple and Rot should be red) is not possible
Ristretto is incapable of displaying this image correctly as it does not know about color management (this is an extreme test image to show whether a program understands CM or not)

Displaying images without color management leads to unpredictable colors because no two screens display the same binary values in an image file identical.
As long as sRGB screens where the common ground that was ugly but not much of a problem for the masses. Now that wide gamut screens that display a gamut of Adobe RGB or wider become more and more common this problem will affect more and more people as the common assumption of everything is sRGB just does not work anymore.

As ristretto is the default image viewer that everyone who installs XFCE will get it should either handle images properly or be exchanged for a program that does it (like geeqie).
X has been supporting an atom that can be used to grab the current screen profile for a few years now, so no user interaction would be required in ristretto to pick up the right profile by default.
Comment 1 Stephan Arts editbugs 2011-10-16 12:52:29 CEST
Oh, that is a bug indeed. Thanks for the bugreport and testcase.
Comment 2 Mike Massonnet editbugs 2011-10-21 13:08:56 CEST
Just to compare with existing software.

From existing image viewers:
- EOG: no
- Shotwell: no
- Geekie: yes

From existing web browsers:
- Chrome/Chromium: no
- Midori: no
- Firefox: yes
Comment 3 Andreas Siegert 2011-10-21 13:27:19 CEST
Yeah, just because other apps are broken, does not mean one needs to make the same mistakes again.
And as I wrote previously, wide gamut screens are becoming a mass market item, leading to quite a lot of frustrated users as the common misconception of everything is sRGB is less and less sustainable.
Comment 4 Stephan Arts editbugs 2011-10-21 14:24:58 CEST
(In reply to comment #3)
> Yeah, just because other apps are broken, does not mean one needs to make the
> same mistakes again.
> And as I wrote previously, wide gamut screens are becoming a mass market item,
> leading to quite a lot of frustrated users as the common misconception of
> everything is sRGB is less and less sustainable.

That's fine and all, but implementing color-profiles is not trivial, at the very least it requires the introduction of another dependency (libcms for example).

Until now, there was no requirement to support this, I never needed it, and nobody asked for it.

At the moment, I am very busy solving other problems, and I don't have time to implement this feature. If you want to have an ETA on this feature, I advise you to send me a patch.
Comment 5 Andreas Siegert 2011-10-21 14:37:52 CEST
@Stephan: 
For me personally it is not really relevant or urgent, I was just responding to Mikes comparison.
It is just a major pita to explain it over and over again to people who wonder why their standard image viewer shows messed up colors. 
The easy solution would but to bundle geeqie instead of ristretto as a default viewer instead of re-implementing the wheel.

cheers
afx
Comment 6 Stephan Arts editbugs 2011-12-29 09:17:00 CET
I have partially implemented it in a private branch. But I am running into what appears to be a bug in libexif: https://sourceforge.net/tracker/?func=detail&aid=3466826&group_id=12272&atid=112272
Comment 7 Stephan Arts editbugs 2011-12-31 11:39:45 CET
Created attachment 4063 
Rudimentary implementation of color-profiles (probably has memory-leaks)

This is a patch that applies against master.

Unfortunately, I do not have a color-managed set-up. (everything defaults to sRGB) and due to a bug in the latest version of libexif, the color-profile information can not be read from the exif-data. So I am not able to test the conversion of 'some-format' to sRGB or from sRGB to the icc-profile of my monitor.

Anyone with a suitable set-up capable of testing this?
Comment 8 Andreas Siegert 2011-12-31 17:33:02 CET
Traveling right now, I'll try next week.
Comment 9 Andreas Siegert 2012-01-01 22:54:12 CET
Could you provide a 32 bit or 64 bit executable?
Comment 10 Stephan Arts editbugs 2012-01-02 08:05:36 CET
You can compile ristretto from source if you install the following packages in (x)ubuntu:

- liblcms2-dev
- libgtk-2.0-dev
- libdbus-glib-1-dev
- libgtk2.0-dev
- libexif-dev
- exo-utils
- xfce4-dev-tools

Then, download the master snapshot from git using the following url:

> http://git.xfce.org/apps/ristretto/snapshot/ristretto-master.tar.bz2

unpack it (using any means necessary).

and, from a terminal execute the following commands

$ cd ristretto-master
$ patch -p0 < ristretto-colorman.patch
$ sh autogen.sh
$ make

If you do not execute 'sudo make install', this version is not installed on your system. You can execute it from the source-dir as followed:

$ ./src/ristretto
Comment 11 Andreas Siegert 2012-01-02 19:21:06 CET
It is -p1 on patch me thinks ;-)

Anyway, the autogen step barfs:
$ sh autogen.sh 
Preparing package directory /data/ristretto/ristretto-master...
Running glib-gettextize --force --copy...
Copying file mkinstalldirs
Copying file po/Makefile.in.in

Please add the files
  codeset.m4 gettext.m4 glibc21.m4 iconv.m4 isc-posix.m4 lcmessage.m4
  progtest.m4
from the /aclocal directory to your autoconf macro directory
or directly to your aclocal.m4 file.
You will also need config.guess and config.sub, which you can get from
ftp://ftp.gnu.org/pub/gnu/config/.

Running intltoolize --automake --copy --force
Patching file 'po/Makefile.in.in'
Running aclocal-1.11   -I /usr/share/xfce4/dev-tools/m4macros -I /usr/share//xfce4/dev-tools/m4macros -I /usr/share/xfce4/dev-tools/m4macros...
configure.in:117: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body
../../lib/autoconf/lang.m4:194: AC_LANG_CONFTEST is expanded from...
../../lib/autoconf/general.m4:2591: _AC_COMPILE_IFELSE is expanded from...
../../lib/autoconf/general.m4:2607: AC_COMPILE_IFELSE is expanded from...
/usr/share/xfce4/dev-tools/m4macros/xdt-features.m4:39: XDT_SUPPORTED_FLAGS is expanded from...
/usr/share/xfce4/dev-tools/m4macros/xdt-features.m4:59: XDT_FEATURE_DEBUG is expanded from...
configure.in:117: the top level
Running autoheader...
configure.in:117: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body
../../lib/autoconf/lang.m4:194: AC_LANG_CONFTEST is expanded from...
../../lib/autoconf/general.m4:2591: _AC_COMPILE_IFELSE is expanded from...
../../lib/autoconf/general.m4:2607: AC_COMPILE_IFELSE is expanded from...
aclocal.m4:10122: XDT_SUPPORTED_FLAGS is expanded from...
aclocal.m4:10142: XDT_FEATURE_DEBUG is expanded from...
configure.in:117: the top level
Running automake-1.11 --force-missing --add-missing --copy --gnu...
configure.in:117: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body
../../lib/autoconf/lang.m4:194: AC_LANG_CONFTEST is expanded from...
../../lib/autoconf/general.m4:2591: _AC_COMPILE_IFELSE is expanded from...
../../lib/autoconf/general.m4:2607: AC_COMPILE_IFELSE is expanded from...
aclocal.m4:10122: XDT_SUPPORTED_FLAGS is expanded from...
aclocal.m4:10142: XDT_FEATURE_DEBUG is expanded from...
configure.in:117: the top level
src/Makefile.am:3: compiling `image_list.c' with per-target flags requires `AM_PROG_CC_C_O' in `configure.in'
configure.in:119: required file `docs/Makefile.in' not found
configure.in:119: required file `docs/manual/Makefile.in' not found
configure.in:119: required file `docs/manual/po/Makefile.in' not found
configure.in:119: required file `docs/manual/media/Makefile.in' not found
Comment 12 Stephan Arts editbugs 2012-01-02 21:49:58 CET
Ah, yeah... my bad.

You need to copy the contents of the xfce4-docs package (ristretto-master branch) to the ./docs directory.

The easiest approach is cloning the git repository and initialising the submodule.

$ git clone git://git.xfce.org/apps/ristretto
$ cd ristretto
$ git submodule update --init

and then:

$ sh autogen.sh
$ make

On ubuntu, you need the 'git-core' package to use git.
Comment 13 Andreas Siegert 2012-01-02 22:43:07 CET
Got it compiled after loading a few more libs.
Displayed images do not look like CM is active. I checked the executable, it is linked against liblcms2.so.2

You should be able to check if CM is working even without a correct monitor profile. 
Use 
dispwin /usr/share/color/icc/sRGB.icc
dispwin -L
(dispwin is part of the argyllCMS package)
to load a standard sRGB profile, not perfect but good enough to test the basic mechanism. 

I assume you take the system profile from the X atom as I did not see any option to set it. 

Compare ristretto and geeqie (you need to set the profile in the geeqie preferences) with the image I pointed to the initial entry for this bug.
Comment 14 Git Bot editbugs 2020-05-25 00:29:08 CEST
-- GitLab Migration Automatic Message --

This bug has been migrated to xfce.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.xfce.org/apps/ristretto/-/issues/5.

Please create an account or use an existing account on one of our supported OAuth providers. 

If you want to fork to submit patches and merge requests please continue reading here: https://docs.xfce.org/contribute/dev/git/start#gitlab_forks_and_merge_requests

Also feel free to reach out to us on the mailing list https://mail.xfce.org/mailman/listinfo/xfce4-dev

Bug #8039

Reported by:
Andreas Siegert
Reported on: 2011-10-16
Last modified on: 2020-05-25

People

Assignee:
Stephan Arts
CC List:
0 users

Version

Version:
master

Attachments

Additional information