Skip to content

Commit

Permalink
#10117: remove unnecessary early handling of potentially bad icc prof…
Browse files Browse the repository at this point in the history
…iles, let lcms decide
  • Loading branch information
pmjdebruijn committed Sep 29, 2014
1 parent 67d53c3 commit a9149a7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 18 deletions.
9 changes: 1 addition & 8 deletions src/common/imageio_tiff.c
Expand Up @@ -246,14 +246,7 @@ int dt_imageio_tiff_read_profile(const char *filename, uint8_t **out)

TIFFGetField(tiff, TIFFTAG_SAMPLESPERPIXEL, &spp);

if(spp != 3 && spp != 4)
{
TIFFClose(tiff);
return -1;
}

if((spp == 3 || spp == 4) &&
TIFFGetField(tiff, TIFFTAG_ICCPROFILE, &profile_len, &profile))
if(TIFFGetField(tiff, TIFFTAG_ICCPROFILE, &profile_len, &profile))
{
*out = (uint8_t*)malloc(profile_len);
memcpy(*out, profile, profile_len);
Expand Down
12 changes: 2 additions & 10 deletions src/iop/colorin.c
Expand Up @@ -920,16 +920,8 @@ void reload_defaults(dt_iop_module_t *module)
else if(!strcmp(ext, "tif") || !strcmp(ext, "tiff"))
{
dt_image_t *img = dt_image_cache_write_get(darktable.image_cache, cimg);
const int profile_size = dt_imageio_tiff_read_profile(filename, &img->profile);
if(profile_size == -1)
{
dt_control_log(_("unsupported input profile has been ignored!"));
}
else
{
img->profile_size = profile_size;
use_eprofile = (img->profile_size > 0);
}
img->profile_size = dt_imageio_tiff_read_profile(filename, &img->profile);
use_eprofile = (img->profile_size > 0);
dt_image_cache_write_release(darktable.image_cache, img, DT_IMAGE_CACHE_RELAXED);
}
else if(!strcmp(ext, "png"))
Expand Down

0 comments on commit a9149a7

Please sign in to comment.