-
-
Notifications
You must be signed in to change notification settings - Fork 727
Open
Description
Hi,
I have a weird issue that has started with version 8.17.x regarding colouspaces and icc profiles.
I have this sample image

That has an embedded profile Adobe RGB (1998), the thing is that if I convert this file into colorspace scRGB and then import a profile then the result is a black image. This was working fine in versions <= 8.16.x
I've made a test case to show you what I mean:
#include <stdio.h>
#include <vips/vips.h>
int
main(int argc, char **argv)
{
VipsImage *in;
double mean;
VipsImage *out;
VipsImage *out2;
if (VIPS_INIT(argv[0]))
vips_error_exit(NULL);
vips_cache_set_max_mem(0);
vips_cache_set_max(0);
vips_concurrency_set(1);
if (argc != 3)
vips_error_exit("usage: %s infile outfile", argv[0]);
in = vips_image_new_from_file(argv[1], NULL);
if (vips_avg(in, &mean, NULL))
vips_error_exit(NULL);
/* generate photo nexative - replace with other vips_ funcs */
if (vips_colourspace(in, &out, VIPS_INTERPRETATION_scRGB, NULL))
vips_error_exit(NULL);
g_clear_object(&in);
size_t length;
const void *data;
if (vips_image_get_blob(out, VIPS_META_ICC_NAME, &data, &length))
vips_error_exit(NULL);
if (vips_icc_is_compatible_profile(out, data, length)) {
printf("Compatible profile\n");
} else {
printf("Not compatible profile\n");
}
if (vips_icc_import(out, &out2, "input_profile", "sRGB_v4_ICC_preference.icc", "embedded", TRUE, NULL))
vips_error_exit(NULL);
g_clear_object(&out);
if (vips_image_write_to_file(out2, argv[2], NULL))
vips_error_exit(NULL);
g_clear_object(&out2);
return 0;
}If I convert it to some other colourspace then is fine.
Do you know if it's normal or did I just stumbled on a bug?
Thank you very much for the help.
Metadata
Metadata
Assignees
Labels
No labels
