Skip to content

Commit

Permalink
Fix #1579: Writing JPG metadata to raw.xmp for groups ".raw + .jpg + …
Browse files Browse the repository at this point in the history
….xmp + .xmp"

#1579

Include additional check for options->metadata.sidecar_extended_name
  • Loading branch information
caclark committed Jan 1, 2025
1 parent 9933350 commit a001755
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions src/filedata/filedata.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1208,17 +1208,30 @@ gchar *FileData::file_data_get_sidecar_path(FileData *fd, gboolean existing_only
{
auto sfd = static_cast<FileData *>(work->data);
work = work->next;
if (g_ascii_strcasecmp(sfd->extension, ".xmp") == 0 || g_ascii_strcasecmp(sfd->extension, extended_extension) == 0)
if (options->metadata.sidecar_extended_name)
{
sidecar_path = g_strdup(sfd->path);
break;
if (g_ascii_strcasecmp(sfd->extension, extended_extension) == 0)
{
sidecar_path = g_strdup(sfd->path);
break;
}
}
else
{
if (g_ascii_strcasecmp(sfd->extension, ".xmp") == 0)
{
sidecar_path = g_strdup(sfd->path);
break;
}
}
}

if (!existing_only && !sidecar_path)
{
if (options->metadata.sidecar_extended_name)
{
sidecar_path = g_strconcat(fd->path, ".xmp", NULL);
}
else
{
g_autofree gchar *base = g_strndup(fd->path, fd->extension - fd->path);
Expand Down

0 comments on commit a001755

Please sign in to comment.