Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
paolodepetrillo committed May 10, 2022
1 parent 8e36c74 commit 7b07656
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 11 deletions.
7 changes: 3 additions & 4 deletions src/common/dng_opcode.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@
*/

#include <glib.h>
#include <stdint.h>
#include <stdio.h>

#include "debug.h"
#include "dng_opcode.h"
#include "image.h"

#define OPCODE_ID_GAINMAP (9)

Expand Down Expand Up @@ -75,7 +74,7 @@ void dt_dng_opcode_process_opcode_list_2(uint8_t *buf, uint32_t buf_size, dt_ima

if(offset + 16 + param_size > buf_size)
{
fprintf(stderr, "[dng_opcode] Invalid opcode size in OpcodeList2\n");
dt_print(DT_DEBUG_IMAGEIO, "[dng_opcode] Invalid opcode size in OpcodeList2\n");
return;
}

Expand Down Expand Up @@ -105,7 +104,7 @@ void dt_dng_opcode_process_opcode_list_2(uint8_t *buf, uint32_t buf_size, dt_ima
}
else
{
fprintf(stderr, "[dng_opcode] OpcodeList2 has unsupported %s opcode %d\n",
dt_print(DT_DEBUG_IMAGEIO, "[dng_opcode] OpcodeList2 has unsupported %s opcode %d\n",
flags & 1 ? "optional" : "mandatory", opcode_id);
}

Expand Down
1 change: 0 additions & 1 deletion src/common/dng_opcode.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

#pragma once

#include <glib.h>
#include <stdint.h>
#include "image.h"

Expand Down
8 changes: 6 additions & 2 deletions src/common/exif.cc
Original file line number Diff line number Diff line change
Expand Up @@ -726,6 +726,10 @@ static gboolean dt_check_dng_opcodes(Exiv2::ExifData &exifData, dt_image_t *img)
g_free(data);
has_opcodes = TRUE;
}
else
{
dt_vprint(DT_DEBUG_IMAGEIO, "DNG OpcodeList2 tag not found\n");
}
return has_opcodes;
}

Expand Down Expand Up @@ -913,7 +917,7 @@ static bool _exif_decode_exif_data(dt_image_t *img, Exiv2::ExifData &exifData)

if (dt_check_usercrop(exifData, img))
{
img->flags |= DT_IMAGE_HAS_ADDITIONAL_EXIF_TAGS;
img->flags |= DT_IMAGE_HAS_ADDITIONAL_DNG_TAGS;
guint tagid = 0;
char tagname[64];
snprintf(tagname, sizeof(tagname), "darktable|mode|exif-crop");
Expand All @@ -923,7 +927,7 @@ static bool _exif_decode_exif_data(dt_image_t *img, Exiv2::ExifData &exifData)

if(dt_check_dng_opcodes(exifData, img))
{
img->flags |= DT_IMAGE_HAS_ADDITIONAL_EXIF_TAGS;
img->flags |= DT_IMAGE_HAS_ADDITIONAL_DNG_TAGS;
}

/*
Expand Down
6 changes: 3 additions & 3 deletions src/common/image.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ typedef enum
DT_IMAGE_4BAYER = 16384,
// image was detected as monochrome
DT_IMAGE_MONOCHROME = 32768,
// image has exif tags which are not cached in the database but must be read and stored in dt_image_t when
// the image is loaded.
DT_IMAGE_HAS_ADDITIONAL_EXIF_TAGS = 65536,
// DNG image has exif tags which are not cached in the database but must be read and stored in dt_image_t
// when the image is loaded.
DT_IMAGE_HAS_ADDITIONAL_DNG_TAGS = 65536,
// image is an sraw
DT_IMAGE_S_RAW = 1 << 17,
// image has a monochrome preview tested
Expand Down
2 changes: 1 addition & 1 deletion src/common/imageio_rawspeed.cc
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ dt_imageio_retval_t dt_imageio_open_rawspeed(dt_image_t *img, const char *filena
// FIXME: grab r->metadata.colorMatrix.

// Get additional exif tags that are not cached in the database
if (img->flags & DT_IMAGE_HAS_ADDITIONAL_EXIF_TAGS)
if (img->flags & DT_IMAGE_HAS_ADDITIONAL_DNG_TAGS)
dt_exif_img_check_additional_tags(img, filename);

if(r->getDataType() == TYPE_FLOAT32)
Expand Down

0 comments on commit 7b07656

Please sign in to comment.