Commit Graph

129 Commits

Author SHA1 Message Date
77dac3ea60 Bug 555562 - GIMP should ask before applying working space profile
Get rid of the "configurable RGB working space profile".

Instead, turn GimpColorConfig's "rgb-profile" property into a
"Preferred RGB profile" thing that is only a hint and never used
without explicit user interaction. Present it next to the built-in
profile in the profile combo boxes and call it "Preferred" in the
prefs dialog and its tooltip.

Most importantly, don't use it as the image's profile when the image
is not tagged with a profile. Untagged images are now always in the
sRGB or linear RGB built-in color spaces.

This commit reduces the "Apply color profile" dialog on file import to
a simple "Convert to built-in RGB", but that dialog is about to be
moved to the core and improved anyway.
2015-08-20 16:02:22 +02:00
fa5d28aad3 plug-ins, pdb: remove "set" and "set-rgb" from the lcms plug-in
and add PDB compat procedures.
2015-08-05 01:03:33 +02:00
4034157774 plug-ins: remove the "set" and "apply" dialogs from the lcms plug-in
The "apply working space profile" dialog is still there.
2015-08-04 22:45:02 +02:00
5672e80ea1 libgimpwidgets: port GimpColorProfileStore and -ComboBox to GFile
and deprecate the old filename-based API. Port everything to use the
new GFile functions.
2015-08-01 16:20:14 +02:00
0693298d63 libgimpcolor, *: change all GimpColorConfig getters to return const gchar*
instead of a gchar* which has to be freed. Cache all the strings in
the GimpColorConfig instance.
2015-07-12 14:10:18 +02:00
c102dde92b libgimpcolor, *: change GimpColorProfile to be a GObject
it used to be a typedef to gpointer and actually was a cmsHPROFILE.

Change its API to be more "standard", remove the public close()
function. The object caches both the cmsHPROFILE and the data/length
ICC blob, so conversions between the two become obsolete (simply call
get_lcms_profile() or get_icc_profile()).

Adapt everything to the new API, but port it in a naive way for now,
the code doesn't take advantage of the new possibilities yet (like
refcounting).
2015-07-10 22:53:59 +02:00
ba1318dda9 app, menus, plug-ins: add new Submenu Image -> Color Management
and move the color profile menu entries there. Add a mapping so 3rd
party plug-ins get moved to the new location automatically.

Also, add a separator after "Duplicate" and move the "Transform"
submenu to the top of the group that has "Scale", "Resize" etc.
2015-06-15 13:20:04 +02:00
f279fd02da plug-ins: use gimp_image_convert_color_profile() in lcms.c 2015-06-10 02:05:14 +02:00
d1102d2be9 pdb, plug-ins: remove two procedures from lcms.c and add PDB compat procs
The lcms plug-in is on its way out: add compat procedures implementing
plug-in-icc-profile-info and plug-in-icc-profile-file-info and remove
that code from lcms.c.
2015-06-07 12:52:37 +02:00
0d01cfd56b plug-ins: use gimp_image_get_effective_color_profile() in the lcms plug-in 2015-06-07 01:58:10 +02:00
87cfbd8d21 plug-ins: use gimp_image_set_color_profile() in the lcms plug-in 2015-06-06 17:05:00 +02:00
5efab4c99b plug-ins: use gimp_image_get_color_profile() in the lcms plug-in 2015-06-05 13:21:56 +02:00
3565b33019 libgimpconfig: rename the new GimpColorConfig profile accessor functions
gimp_color_config_get_foo_profile() -> get_foo_color_profile()

because the old names clash with possible future accessors for the raw
filename properties.
2015-06-03 09:57:34 +02:00
4910c28957 libgimpcolor: rename the gimp_lcms_*() functions to gimp_color_profile_*()
because it doesn't make sense to call the typedef GimpColorProfile
but the function namespace gimp_lcms_*().
2015-06-03 09:41:23 +02:00
08b19a9bbc plug-ins: minor simplifications because GimpColorConfig has an API now 2015-05-26 08:09:29 +02:00
f939818c4d plug-ins: use gimp_lcms_get_format() in the lcms plug-in 2015-05-08 12:53:43 +02:00
6c800db1cc Use the newly added profile utility functions all over the place 2015-05-06 16:38:57 +02:00
783bbab8a8 plug-ins: fix lcms.c plug-in half conversion 2015-02-27 19:14:11 +01:00
a0398e5028 configure.ac, plug-ins: require lcms >= 2.6 and remove #ifdef from lcms.c 2015-02-21 00:33:37 +01:00
99abc566d4 fix some precedence errors
Spotted by Andrey Karpov using static code analysis:
   http://www.viva64.com/en/b/0273/
2014-08-16 00:37:13 +02:00
b7863269f0 libgimpcolor: change gimp_lcms_profile_open_from_file() from filename to GFile
and change most of the lcms plug-in to using GFile too.
2014-07-04 23:57:27 +02:00
b5530e9e3d Use the new GeglAccessMode enum instead of the old values 2014-07-02 02:00:35 +02:00
4bd5c185cc plug-ins: gtk_image_new_from_stock() -> from_icon_name() 2014-05-12 00:20:48 +02:00
614c61a3dd Don't #include <glib.h> before <lcms.h>
The include claimed to be because of "inline" in the lcms header, but
that was probably lcms1, since there is no trace of inline in the
lcms2 header.
2014-04-10 20:48:22 +02:00
661317f74c libgimpwidgets: make using GimpColorProfileComboBox easier
If the passed dialog is a GimpColorProfileChooserDialog, handle its
"response" signal automatically and also destroy it when the combo box
is destroyed (before we leaked all dialogs). Remove the same callback
from all places using GimpColorProfileComboBox.
2014-04-04 17:09:54 +02:00
3f826d02fa libgimpwidgets: make GimpColorProfileComboBox use lcms
and improve gimp_color_profile_combo_box_set_active() to get the
profile's label from the ICC file if no label was provided. Simplifies
all its callers and removes code duplication.
2014-04-02 13:03:52 +02:00
59f59726e3 plug-ins: simplify the lcms format fallback code
Instead of adding multiple #else ... #endif branches for missing lcms
types, do the fallback at the end if no lcms type could be determined
for the layer's pixel format.
2014-04-02 00:14:24 +02:00
eb5bf3c2ba plug-ins: add fallbacks for all pixel formats not supported my lcms
- fall back to float for missing half float
- implement double and fallback to RGBA float for missing RGBA double
- fall back to float for everything else potentially missing
2014-03-31 17:40:15 +02:00
d7037650df libgimpcolor: add gimp_lcms_profile_get_label()
which returns a string meant to label the profile in the GUI, it's
either the profile's description, its model, or "(unnamed profile)" as
a fallback. Use the function instead of duplicating that logic
inconsistently and imcompletely all over the place.
2014-03-30 03:12:42 +02:00
67391f6d9e plug-ins: don't create bogus combo entries in lcms_icc_combo_box_new()
- verify that GimpColorConfig.rgb_profile actually is an RGB profile.
- on failure, don't assoociate the rgb_profile filename with the
  built-in sRGB profile.
2014-03-30 01:34:34 +01:00
18c0ab0a19 plug-ins: remove undo_group parameter from lcms_image_set_profile()
and simply always push an undo group, there is no harm or overhead in
nested undo groups.
2014-03-29 14:54:41 +01:00
32e47cf70d libgimpcolor: add gimp_lcms_profile_is_equal()
and remove all of our own MD5 digest code and API. is_equal() uses
lcms' own MD5 API which I missed before. Thanks Elle for pointing that
out :)
2014-03-29 10:40:47 +01:00
b3395d989e libgimpcolor: return an optional MD5 digest from gimp_lcms_create_srgb_profile()
pass NULL in most places, use the feature in the lcms.c plu-gin.
2014-03-23 23:34:47 +01:00
a0e8913a43 plug-ins: verify that GimpColorConfig.rgb_profile is actually for RGB
and remove the RGB check from all callers of lcms_image_get_profile(),
the function now returns an RGB profile or NULL. This implicitly stop
checking that 'icc-profile' actually contains an RGB profile.
2014-03-23 21:24:08 +01:00
0bdc6fbe3c plug-ins: use gimp_lcms_profile_open_*() in the lcms plug-in
And clean up stuff to pass error messages further up.
2014-03-16 15:57:14 +01:00
ebc53672cb libgimpcolor: add gimp_lcms_profile_is_rgb() and _is_cmyk()
And change all lcms code to use it.
2014-03-15 21:47:13 +01:00
4321cda30c plug-ins: simply ask the built-in sRGB profile for its strings
instead of special casing it. And some minor code cleanup.
2014-03-15 00:09:35 +01:00
89b489b9bb modules, plug-ins: use GimpColorProfileChooserDialog
instead of selfmade file choosers for picking color profiles from
disk.
2014-03-14 23:02:14 +01:00
d576ee8a6d plug-ins: use gimp_lcms_profile_get_summary() in the lcms plug-in 2014-03-14 20:26:15 +01:00
eee6fa1e4b libgimpcolor: start adding profile utility functions to gimplcms.[ch]
Add functions to get a profile's description, manufacturer, model and
copyright, and use them instead of implementing the same 10 times.

Also add a GimpColorProfile typedef which avoids both having to
include lcms globally or using a gpointer instead (which looks bad and
non-descriptive in an API).
2014-03-14 01:48:39 +01:00
cd65cc57b2 Bug 725169 - Add ICC profile copyright information to Image...
...Properties/Color Profile window

And improve the info of the bultin sRGB profile.
2014-02-26 00:12:22 +01:00
05c5ca3216 Bug 723787 - Neutral sRGB profile matching Argyllcms sRGB.icm
Add gimp_lcms_create_srgb_profile() to libgimpcolor and use it where
we used to call cmsCreate_sRGBProfile().
2014-02-09 23:10:56 +01:00
d0f7e713bb lcms: avoid dereferencing null pointers 2013-11-07 12:20:33 +01:00
961d03d795 Bug 709857 - Lcms plugin crashes if RGB profile does not exist
Always check the return value of lcms_load_profile(config->rgb_profile)
and use the builtin sRGB profile if it returns NULL.
2013-11-04 23:17:41 +01:00
424129cc60 Bug 710974 - Convert to Color profile fails on images with layer groups
Handle layer groups recursively, and don't convert the group layer
itself.
2013-10-29 19:35:26 +01:00
ceebfe5d01 Bug 694679 - lcms plug-in half-floating point support
Again, this time in an #ifdef: add support for half-floating point ICC
profile conversions.
2013-02-26 09:12:02 +01:00
1e6d984c66 Revert "plug-ins: add support for half-floating point ICC profile conversions to lcms"
This reverts commit fd5a017633.

We can't depend on lcms 2.4 yet.
2013-02-25 23:25:27 +01:00
fd5a017633 plug-ins: add support for half-floating point ICC profile conversions to lcms 2013-02-25 22:50:23 +01:00
b47107123a plug-ins: fix indexed palette handling in lcms.c
gimp_image_get/set_colormap() returns/takes the number of bytes in the
colormap, not the number of colors.
2012-12-14 21:12:36 +01:00
9c371064b7 plug-ins: fix the build in lcms.c 2012-11-28 09:25:34 +01:00