Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[imageio] Modify the libraw loader so that it can work as a fallback loader #16334

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/imageio/imageio_libraw.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
This file is part of darktable,
Copyright (C) 2021-2023 darktable developers.
Copyright (C) 2021-2024 darktable developers.

darktable is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -259,6 +259,8 @@ const model_map_t modelMap[] = {

/* LibRaw is expected to read only new Canon CR3 files */

// Let's deactivate self-restriction in order to be able to act as a fallback loader:
#if 0
static gboolean _supported_image(const gchar *filename)
{
// At the moment of writing this code CR3 files are not supported by RawSpeed,
Expand Down Expand Up @@ -290,6 +292,7 @@ static gboolean _supported_image(const gchar *filename)
g_free(extensions_whitelist);
return FALSE;
}
#endif

void _check_libraw_missing_support(const struct dt_image_t *img)
{
Expand Down Expand Up @@ -339,7 +342,10 @@ dt_imageio_retval_t dt_imageio_open_libraw(dt_image_t *img,
{
int err = DT_IMAGEIO_LOAD_FAILED;
int libraw_err = LIBRAW_SUCCESS;
if(!_supported_image(filename)) return DT_IMAGEIO_LOAD_FAILED;

// Let's deactivate self-restriction in order to be able to act as a fallback loader:
// if(!_supported_image(filename)) return DT_IMAGEIO_LOAD_FAILED;

if(!img->exif_inited) (void)dt_exif_read(img, filename);

libraw_data_t *raw = libraw_init(0);
Expand Down