diff --git a/src/cmake/testing.cmake b/src/cmake/testing.cmake index e1be9b89f8..559286e591 100644 --- a/src/cmake/testing.cmake +++ b/src/cmake/testing.cmake @@ -455,7 +455,7 @@ macro (oiio_add_all_tests) IMAGEDIR oiio-images/psd) oiio_add_tests (ptex FOUNDVAR Ptex_FOUND ENABLEVAR ENABLE_PTEX) - oiio_add_tests (raw + oiio_add_tests (raw raw-thumbnail FOUNDVAR LIBRAW_FOUND ENABLEVAR ENABLE_LIBRAW IMAGEDIR oiio-images/raw) oiio_add_tests (rla diff --git a/src/doc/builtinplugins.rst b/src/doc/builtinplugins.rst index 8f12260530..aca8793a57 100644 --- a/src/doc/builtinplugins.rst +++ b/src/doc/builtinplugins.rst @@ -2339,6 +2339,18 @@ options are supported: - A path to a file containing the list of bad pixels in libraw format: a plain text where each line describes a single bad pixel using three numbers separated by whitespace for the column, row and UNIX timestamp. + * - ``raw:thumbnail_index`` + - int + - An index of the thumbnail that gets returned from get_thumbnail(). The + default index (-1) leaves the choice to libraw, which normally would pick + the largest resolution. + (Default: -1) + * - ``raw:thumbnail_sort`` + - int + - Controls the sort order of the list the thumbnail gets picked from. + -1 - sort small-to-large, 0 - don't sort, use the original file order, + 1 - sort large-to-small. + (Default: 0) | .. _sec-bundledplugins-rla: diff --git a/src/raw.imageio/rawinput.cpp b/src/raw.imageio/rawinput.cpp index f2ffa9d2b7..c9eef6fe13 100644 --- a/src/raw.imageio/rawinput.cpp +++ b/src/raw.imageio/rawinput.cpp @@ -79,7 +79,10 @@ class RawInput final : public ImageInput { bool m_unpacked = false; std::unique_ptr m_processor; libraw_processed_image_t* m_image = nullptr; - bool m_do_scene_linear_scale = false; + libraw_processed_image_t* m_thumb = nullptr; + int m_thumb_index = -1; + + bool m_do_scene_linear_scale = false; float m_camera_to_scene_linear_scale = (1.0f / 0.45f); // see open_raw for details bool m_do_balance_clamped = false; @@ -1098,7 +1101,99 @@ RawInput::open_raw(bool unpack, bool process, const std::string& name, m_spec.attribute("Orientation", original_flip); } - // FIXME -- thumbnail possibly in m_processor->imgdata.thumbnail +#if LIBRAW_VERSION < LIBRAW_MAKE_VERSION(0, 21, 0) + if (m_processor->imgdata.thumbnail.tlength > 0) { + auto width = m_processor->imgdata.thumbnail.twidth; + auto height = m_processor->imgdata.thumbnail.theight; + + // see note below + if (width == 0) + width = -1; + if (height == 0) + height = -1; + + m_spec.attribute("thumbnail_width", width); + m_spec.attribute("thumbnail_height", height); + } +#else + + auto thumb_count = m_processor->imgdata.thumbs_list.thumbcount; + if (thumb_count > 0) { + m_thumb_index = config.get_int_attribute("raw:thumbnail_index", -1); + + int width = 0; + int height = 0; + + if (m_thumb_index < -1) { + errorfmt("Invalid thumbnail index ({})", m_thumb_index); + return false; + } + if (m_thumb_index == -1) { + // Use the default from LibRaw, which will always be the largest one + width = m_processor->imgdata.thumbnail.twidth; + height = m_processor->imgdata.thumbnail.theight; + } else { + m_thumb_index = std::min(m_thumb_index, thumb_count - 1); + + // sort the thumbnails by their size if requested + int sort_order = config.get_int_attribute("raw:thumbnail_sort", 0); + + if (sort_order < -1 || sort_order > 1) { + errorfmt("Invalid thumbnail sort order ({})", sort_order); + return false; + } + + if (sort_order != 0) { + auto index_map = std::vector(thumb_count); + for (auto i = 0; i < thumb_count; ++i) + index_map[i] = i; + + if (sort_order == -1) { + std::sort(index_map.begin(), index_map.end(), + [&](size_t a, size_t b) { + return m_processor->imgdata.thumbs_list + .thumblist[a] + .tlength + < m_processor->imgdata.thumbs_list + .thumblist[b] + .tlength; + }); + } else { + std::sort(index_map.begin(), index_map.end(), + [&](size_t a, size_t b) { + return m_processor->imgdata.thumbs_list + .thumblist[a] + .tlength + > m_processor->imgdata.thumbs_list + .thumblist[b] + .tlength; + }); + } + + m_thumb_index = index_map[m_thumb_index]; + } + + width = m_processor->imgdata.thumbs_list.thumblist[m_thumb_index] + .twidth; + height = m_processor->imgdata.thumbs_list.thumblist[m_thumb_index] + .theight; + } + + // LibRaw sometimes won't set the twidth/theight if the type is JPEG, + // however the OIIO::ImageBuf interface checks for non-zero + // "thumbnail_width" and "thumbnail_height" to determine if a thumbnail + // is present. In that case we set them to -1 which emables the ImageBuf + // interface but is clear that the dimensions have not been set. + if (width == 0) + width = -1; + if (height == 0) + height = -1; + + m_spec.attribute("thumbnail_width", width); + m_spec.attribute("thumbnail_height", height); + } +#endif + get_lensinfo(); get_shootinginfo(); @@ -1580,6 +1675,12 @@ RawInput::close() LibRaw::dcraw_clear_mem(m_image); m_image = nullptr; } + + if (m_thumb) { + LibRaw::dcraw_clear_mem(m_thumb); + m_thumb = nullptr; + } + m_processor.reset(); m_unpacked = false; m_process = true; @@ -1765,84 +1866,84 @@ bool RawInput::get_thumbnail(ImageBuf& thumb, int subimage) { if (m_processor == nullptr) { - _errorfmt(this, subimage, + _errorfmt(this, m_thumb_index, "ImageInput hasn't been initialised properly"); return false; } #if LIBRAW_VERSION < LIBRAW_MAKE_VERSION(0, 21, 0) - if (subimage > 0) { - // Older versions of Libraw supported a single thumbnail per image. - // No error here. - return false; - } int errcode = m_processor->unpack_thumb(); if (errcode != 0) { if (errcode != LIBRAW_REQUEST_FOR_NONEXISTENT_IMAGE) - _errorfmt(this, subimage, "unpack_thumb error"); + _errorfmt(this, m_thumb_index, "unpack_thumb error"); return false; } #else - int errcode = m_processor->unpack_thumb_ex(subimage); + int errcode; + if (m_thumb_index == -1) + errcode = m_processor->unpack_thumb(); + else + errcode = m_processor->unpack_thumb_ex(m_thumb_index); + if (errcode != 0) { if (errcode != LIBRAW_REQUEST_FOR_NONEXISTENT_THUMBNAIL) - _errorfmt(this, subimage, "unpack_thumb_ex error"); + _errorfmt(this, m_thumb_index, "unpack_thumb_ex error"); return false; } #endif - libraw_processed_image_t* mem_thumb = m_processor->dcraw_make_mem_thumb( - &errcode); - if (mem_thumb == nullptr) { - _errorfmt(this, subimage, "dcraw_make_mem_thumb error"); - return false; + if (!m_thumb) { + m_thumb = m_processor->dcraw_make_mem_thumb(&errcode); + if (m_thumb == nullptr) { + _errorfmt(this, m_thumb_index, "dcraw_make_mem_thumb error"); + return false; + } } std::string image_type; - if (mem_thumb->type == LibRaw_image_formats::LIBRAW_IMAGE_JPEG) + if (m_thumb->type == LibRaw_image_formats::LIBRAW_IMAGE_JPEG) image_type = "jpeg"; - else if (mem_thumb->type == LibRaw_image_formats::LIBRAW_IMAGE_BITMAP) + else if (m_thumb->type == LibRaw_image_formats::LIBRAW_IMAGE_BITMAP) image_type = "bmp"; #if LIBRAW_VERSION >= LIBRAW_MAKE_VERSION(0, 22, 0) - else if (mem_thumb->type == LibRaw_image_formats::LIBRAW_IMAGE_JPEGXL) + else if (m_thumb->type == LibRaw_image_formats::LIBRAW_IMAGE_JPEGXL) image_type = "jpegxl"; - else if (mem_thumb->type == LibRaw_image_formats::LIBRAW_IMAGE_H265) + else if (m_thumb->type == LibRaw_image_formats::LIBRAW_IMAGE_H265) image_type = "h265"; #endif if (image_type == "h265") { - _errorfmt(this, subimage, "h265 thumbnails are not supported yet"); + _errorfmt(this, m_thumb_index, "h265 thumbnails are not supported yet"); return false; } if (image_type.empty()) { - _errorfmt(this, subimage, "unknown image type {}", - static_cast(mem_thumb->type)); + _errorfmt(this, m_thumb_index, "unknown image type {}", + static_cast(m_thumb->type)); return false; } if (image_type == "bmp") { - size_t data_size = mem_thumb->width * mem_thumb->height - * mem_thumb->colors; - if (data_size != mem_thumb->data_size) + size_t data_size = m_thumb->width * m_thumb->height * m_thumb->colors; + if (data_size != m_thumb->data_size) return false; - ImageSpec image_spec(mem_thumb->width, mem_thumb->height, - mem_thumb->colors, TypeDesc::UCHAR); + ImageSpec image_spec(m_thumb->width, m_thumb->height, m_thumb->colors, + TypeDesc::UCHAR); thumb.reset(image_spec); - thumb.set_pixels(thumb.roi_full(), TypeDesc::UCHAR, mem_thumb->data); + thumb.set_pixels(thumb.roi_full(), TypeDesc::UCHAR, m_thumb->data); } else { auto image_input = OIIO::ImageInput::create(image_type, false); if (image_input == nullptr) { - _errorfmt(this, subimage, "OIIO::ImageInput::create(\{}\") error", - image_type); + _errorfmt(this, m_thumb_index, + "OIIO::ImageInput::create(\{}\") error", image_type); return false; } - Filesystem::IOMemReader proxy(mem_thumb->data, mem_thumb->data_size); + Filesystem::IOMemReader proxy(m_thumb->data, m_thumb->data_size); bool result = image_input->valid_file(&proxy); if (!result) { - _errorfmt(this, subimage, + _errorfmt(this, m_thumb_index, "the thumbnail is not a valid image of type \"{}\"", image_type); return false; @@ -1855,8 +1956,9 @@ RawInput::get_thumbnail(ImageBuf& thumb, int subimage) result = image_input->open("", image_spec, temp_spec); if (!result) { _errorfmt( - this, subimage, - "failed to initialise an ImageInput object with the thumbnail data"); + this, m_thumb_index, + "failed to initialise an ImageInput object with the thumbnail" + " data"); return false; } @@ -1866,11 +1968,14 @@ RawInput::get_thumbnail(ImageBuf& thumb, int subimage) thumb.localpixels()); if (!result) { _errorfmt( - this, subimage, - "failed to initialise an ImageInput object of type \"{}\" with the thumbnail data", + this, m_thumb_index, + "failed to initialise an ImageInput object of type \"{}\" with" + " the thumbnail data", image_type); + image_input->close(); return false; } + image_input->close(); } return true; diff --git a/testsuite/raw-thumbnail/ref/out-libraw0.20.0.txt b/testsuite/raw-thumbnail/ref/out-libraw0.20.0.txt new file mode 100644 index 0000000000..86e4f792a9 --- /dev/null +++ b/testsuite/raw-thumbnail/ref/out-libraw0.20.0.txt @@ -0,0 +1,72 @@ +RAW_CANON_EOS_7D.CR2 index -1 sort False +5184 x 3456, 3 channel, uint8 + channel list: R, G, B +RAW_CANON_EOS_7D.CR2 index 0 sort False +5184 x 3456, 3 channel, uint8 + channel list: R, G, B +RAW_CANON_EOS_7D.CR2 index 1 sort True +5184 x 3456, 3 channel, uint8 + channel list: R, G, B +RAW_FUJI_F700.RAF index -1 sort False +1280 x 960, 3 channel, uint8 + channel list: R, G, B +RAW_FUJI_F700.RAF index 0 sort False +1280 x 960, 3 channel, uint8 + channel list: R, G, B +RAW_FUJI_F700.RAF index 1 sort True +1280 x 960, 3 channel, uint8 + channel list: R, G, B +RAW_NIKON_D3X.NEF index -1 sort False +6048 x 4032, 3 channel, uint8 + channel list: R, G, B +RAW_NIKON_D3X.NEF index 0 sort False +6048 x 4032, 3 channel, uint8 + channel list: R, G, B +RAW_NIKON_D3X.NEF index 1 sort True +6048 x 4032, 3 channel, uint8 + channel list: R, G, B +RAW_OLYMPUS_E3.ORF index -1 sort False +1600 x 1200, 3 channel, uint8 + channel list: R, G, B +RAW_OLYMPUS_E3.ORF index 0 sort False +1600 x 1200, 3 channel, uint8 + channel list: R, G, B +RAW_OLYMPUS_E3.ORF index 1 sort True +1600 x 1200, 3 channel, uint8 + channel list: R, G, B +RAW_PANASONIC_DMC-GF1.RW2 index -1 sort False +1920 x 1440, 3 channel, uint8 + channel list: R, G, B +RAW_PANASONIC_DMC-GF1.RW2 index 0 sort False +1920 x 1440, 3 channel, uint8 + channel list: R, G, B +RAW_PANASONIC_DMC-GF1.RW2 index 1 sort True +1920 x 1440, 3 channel, uint8 + channel list: R, G, B +RAW_PANASONIC_G1.RW2 index -1 sort False +1920 x 1440, 3 channel, uint8 + channel list: R, G, B +RAW_PANASONIC_G1.RW2 index 0 sort False +1920 x 1440, 3 channel, uint8 + channel list: R, G, B +RAW_PANASONIC_G1.RW2 index 1 sort True +1920 x 1440, 3 channel, uint8 + channel list: R, G, B +RAW_PENTAX_K200D.PEF index -1 sort False +3872 x 2592, 3 channel, uint8 + channel list: R, G, B +RAW_PENTAX_K200D.PEF index 0 sort False +3872 x 2592, 3 channel, uint8 + channel list: R, G, B +RAW_PENTAX_K200D.PEF index 1 sort True +3872 x 2592, 3 channel, uint8 + channel list: R, G, B +RAW_SONY_A300.ARW index -1 sort False +1616 x 1080, 3 channel, uint8 + channel list: R, G, B +RAW_SONY_A300.ARW index 0 sort False +1616 x 1080, 3 channel, uint8 + channel list: R, G, B +RAW_SONY_A300.ARW index 1 sort True +1616 x 1080, 3 channel, uint8 + channel list: R, G, B diff --git a/testsuite/raw-thumbnail/ref/out.txt b/testsuite/raw-thumbnail/ref/out.txt new file mode 100644 index 0000000000..5e6ccb547f --- /dev/null +++ b/testsuite/raw-thumbnail/ref/out.txt @@ -0,0 +1,72 @@ +RAW_CANON_EOS_7D.CR2 index -1 sort False +5184 x 3456, 3 channel, uint8 + channel list: R, G, B +RAW_CANON_EOS_7D.CR2 index 0 sort False +5184 x 3456, 3 channel, uint8 + channel list: R, G, B +RAW_CANON_EOS_7D.CR2 index 1 sort True + 670 x 432, 3 channel, uint8 + channel list: R, G, B +RAW_FUJI_F700.RAF index -1 sort False +1280 x 960, 3 channel, uint8 + channel list: R, G, B +RAW_FUJI_F700.RAF index 0 sort False + 160 x 120, 3 channel, uint8 + channel list: R, G, B +RAW_FUJI_F700.RAF index 1 sort True +1280 x 960, 3 channel, uint8 + channel list: R, G, B +RAW_NIKON_D3X.NEF index -1 sort False +6048 x 4032, 3 channel, uint8 + channel list: R, G, B +RAW_NIKON_D3X.NEF index 0 sort False + 160 x 120, 3 channel, uint8 + channel list: R, G, B +RAW_NIKON_D3X.NEF index 1 sort True + 570 x 375, 3 channel, uint8 + channel list: R, G, B +RAW_OLYMPUS_E3.ORF index -1 sort False +1600 x 1200, 3 channel, uint8 + channel list: R, G, B +RAW_OLYMPUS_E3.ORF index 0 sort False +1600 x 1200, 3 channel, uint8 + channel list: R, G, B +RAW_OLYMPUS_E3.ORF index 1 sort True +1600 x 1200, 3 channel, uint8 + channel list: R, G, B +RAW_PANASONIC_DMC-GF1.RW2 index -1 sort False +1920 x 1440, 3 channel, uint8 + channel list: R, G, B +RAW_PANASONIC_DMC-GF1.RW2 index 0 sort False +1920 x 1440, 3 channel, uint8 + channel list: R, G, B +RAW_PANASONIC_DMC-GF1.RW2 index 1 sort True +1920 x 1440, 3 channel, uint8 + channel list: R, G, B +RAW_PANASONIC_G1.RW2 index -1 sort False +1920 x 1440, 3 channel, uint8 + channel list: R, G, B +RAW_PANASONIC_G1.RW2 index 0 sort False +1920 x 1440, 3 channel, uint8 + channel list: R, G, B +RAW_PANASONIC_G1.RW2 index 1 sort True +1920 x 1440, 3 channel, uint8 + channel list: R, G, B +RAW_PENTAX_K200D.PEF index -1 sort False +3872 x 2592, 3 channel, uint8 + channel list: R, G, B +RAW_PENTAX_K200D.PEF index 0 sort False + 160 x 120, 3 channel, uint8 + channel list: R, G, B +RAW_PENTAX_K200D.PEF index 1 sort True +3872 x 2592, 3 channel, uint8 + channel list: R, G, B +RAW_SONY_A300.ARW index -1 sort False +1616 x 1080, 3 channel, uint8 + channel list: R, G, B +RAW_SONY_A300.ARW index 0 sort False +1616 x 1080, 3 channel, uint8 + channel list: R, G, B +RAW_SONY_A300.ARW index 1 sort True +1616 x 1080, 3 channel, uint8 + channel list: R, G, B diff --git a/testsuite/raw-thumbnail/run.py b/testsuite/raw-thumbnail/run.py new file mode 100755 index 0000000000..b8dcacbf00 --- /dev/null +++ b/testsuite/raw-thumbnail/run.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python + +# Copyright Contributors to the OpenImageIO project. +# SPDX-License-Identifier: Apache-2.0 +# https://github.com/AcademySoftwareFoundation/OpenImageIO + +import os +OIIO_TESTSUITE_IMAGEDIR = os.getenv('OIIO_TESTSUITE_IMAGEDIR') + +###################################################################### +# main test starts here + +redirect = " >> out.txt 2>&1 " + +test_files = [ + 'RAW_CANON_EOS_7D.CR2', + 'RAW_FUJI_F700.RAF', + 'RAW_NIKON_D3X.NEF', + 'RAW_OLYMPUS_E3.ORF', + 'RAW_PANASONIC_DMC-GF1.RW2', + 'RAW_PANASONIC_G1.RW2', + 'RAW_PENTAX_K200D.PEF', + 'RAW_SONY_A300.ARW' +] + +def read_thumbnail(filename, index = -1, sort = False): + + label = '{} index {} sort {}'.format(filename, index, sort) + params = '--echo "' + label + '" ' + if index != -1: + params += '-iconfig "raw:thumbnail_index" ' + str(index) + ' ' + if sort: + params += '-iconfig "raw:thumbnail_sort" -1 ' + + params += OIIO_TESTSUITE_IMAGEDIR + '/' + file + params += ' --thumbnail-get --eraseattrib ".*" --printinfo' + + return params + +for file in test_files: + command += oiiotool (read_thumbnail(file, -1)) + command += oiiotool (read_thumbnail(file, 0)) + command += oiiotool (read_thumbnail(file, 1, True)) + +outputs = [ "out.txt" ] diff --git a/testsuite/raw/ref/out-libraw-0.20.2-gh.txt b/testsuite/raw/ref/out-libraw-0.20.2-gh.txt index bec9f0c940..fd4bf9983d 100644 --- a/testsuite/raw/ref/out-libraw-0.20.2-gh.txt +++ b/testsuite/raw/ref/out-libraw-0.20.2-gh.txt @@ -10,6 +10,8 @@ Orientation: 1 (normal) PixelAspectRatio: 1 Software: "Firmware Version 1.0.7" + thumbnail_height: 3456 + thumbnail_width: 5184 Canon:AESetting: 0 (normal AE) Canon:AFAreaMode: 0 Canon:AFPoint: 0 @@ -96,6 +98,8 @@ Orientation: 1 (normal) PixelAspectRatio: 1 Software: "Ver.1.00 " + thumbnail_height: 4032 + thumbnail_width: 6048 Exif:ApertureValue: 4.97085 (f/5.6) Exif:Contrast: 0 (normal) Exif:CustomRendered: 0 (no) @@ -187,6 +191,8 @@ Orientation: 1 (normal) PixelAspectRatio: 1 Software: "Digital Camera FinePix F700 Ver2.00" + thumbnail_height: 960 + thumbnail_width: 1280 Exif:ApertureValue: 3.69599 (f/3.6) Exif:BrightnessValue: 773/100 (7.73) Exif:CompressedBitsPerPixel: 30/10 (3) @@ -261,6 +267,8 @@ Orientation: 1 (normal) PixelAspectRatio: 1 Software: "Ver.1.00 " + thumbnail_height: 4032 + thumbnail_width: 6048 Exif:ApertureValue: 4.97085 (f/5.6) Exif:Contrast: 0 (normal) Exif:CustomRendered: 0 (no) @@ -355,6 +363,8 @@ Orientation: 1 (normal) PixelAspectRatio: 1 Software: "Version 1.0 " + thumbnail_height: 1200 + thumbnail_width: 1600 Exif:ApertureValue: 2 (f/2.0) Exif:Contrast: 0 (normal) Exif:CustomRendered: 1 (yes) @@ -428,6 +438,8 @@ Orientation: 1 (normal) PixelAspectRatio: 1 Software: "K200D Ver 1.00 " + thumbnail_height: 2592 + thumbnail_width: 3872 Exif:ApertureValue: 6 (f/8.0) Exif:Contrast: 0 (normal) Exif:CustomRendered: 0 (no) @@ -497,6 +509,8 @@ Orientation: 1 (normal) PixelAspectRatio: 1 Software: "DSLR-A300 v1.00" + thumbnail_height: 1080 + thumbnail_width: 1616 Exif:ApertureValue: 4.97085 (f/5.6) Exif:BrightnessValue: 137/100 (1.37) Exif:CompressedBitsPerPixel: 8/1 (8) diff --git a/testsuite/raw/ref/out-libraw0.20.0-gh.txt b/testsuite/raw/ref/out-libraw0.20.0-gh.txt index c6b813c1b7..885142ec1b 100644 --- a/testsuite/raw/ref/out-libraw0.20.0-gh.txt +++ b/testsuite/raw/ref/out-libraw0.20.0-gh.txt @@ -10,6 +10,8 @@ Orientation: 1 (normal) PixelAspectRatio: 1 Software: "Firmware Version 1.0.7" + thumbnail_height: 3456 + thumbnail_width: 5184 Canon:AESetting: 0 (normal AE) Canon:AFAreaMode: 0 Canon:AFPoint: 0 @@ -96,6 +98,8 @@ Orientation: 1 (normal) PixelAspectRatio: 1 Software: "Ver.1.00 " + thumbnail_height: 4032 + thumbnail_width: 6048 Exif:ApertureValue: 4.97085 (f/5.6) Exif:Contrast: 0 (normal) Exif:CustomRendered: 0 (no) @@ -186,6 +190,8 @@ Orientation: 1 (normal) PixelAspectRatio: 1 Software: "Digital Camera FinePix F700 Ver2.00" + thumbnail_height: 960 + thumbnail_width: 1280 Exif:ApertureValue: 3.69599 (f/3.6) Exif:BrightnessValue: 773/100 (7.73) Exif:CompressedBitsPerPixel: 30/10 (3) @@ -259,6 +265,8 @@ Orientation: 1 (normal) PixelAspectRatio: 1 Software: "Ver.1.00 " + thumbnail_height: 4032 + thumbnail_width: 6048 Exif:ApertureValue: 4.97085 (f/5.6) Exif:Contrast: 0 (normal) Exif:CustomRendered: 0 (no) @@ -352,6 +360,8 @@ Orientation: 1 (normal) PixelAspectRatio: 1 Software: "Version 1.0 " + thumbnail_height: 1200 + thumbnail_width: 1600 Exif:ApertureValue: 2 (f/2.0) Exif:Contrast: 0 (normal) Exif:CustomRendered: 1 (yes) @@ -424,6 +434,8 @@ Orientation: 1 (normal) PixelAspectRatio: 1 Software: "K200D Ver 1.00 " + thumbnail_height: 2592 + thumbnail_width: 3872 Exif:ApertureValue: 6 (f/8.0) Exif:Contrast: 0 (normal) Exif:CustomRendered: 0 (no) @@ -492,6 +504,8 @@ Orientation: 1 (normal) PixelAspectRatio: 1 Software: "DSLR-A300 v1.00" + thumbnail_height: 1080 + thumbnail_width: 1616 Exif:ApertureValue: 4.97085 (f/5.6) Exif:BrightnessValue: 137/100 (1.37) Exif:CompressedBitsPerPixel: 8/1 (8) diff --git a/testsuite/raw/ref/out-libraw0.20.0.txt b/testsuite/raw/ref/out-libraw0.20.0.txt index 8bceb81d29..eecc75b80d 100644 --- a/testsuite/raw/ref/out-libraw0.20.0.txt +++ b/testsuite/raw/ref/out-libraw0.20.0.txt @@ -10,6 +10,8 @@ Orientation: 1 (normal) PixelAspectRatio: 1 Software: "Firmware Version 1.0.7" + thumbnail_height: 3456 + thumbnail_width: 5184 Canon:AESetting: 0 (normal AE) Canon:AFAreaMode: 0 Canon:AFPoint: 0 @@ -95,6 +97,8 @@ Orientation: 1 (normal) PixelAspectRatio: 1 Software: "Ver.1.00 " + thumbnail_height: 4032 + thumbnail_width: 6048 Exif:ApertureValue: 4.97085 (f/5.6) Exif:Contrast: 0 (normal) Exif:CustomRendered: 0 (no) @@ -185,6 +189,8 @@ Orientation: 1 (normal) PixelAspectRatio: 1 Software: "Digital Camera FinePix F700 Ver2.00" + thumbnail_height: 960 + thumbnail_width: 1280 Exif:ApertureValue: 3.69599 (f/3.6) Exif:BrightnessValue: 773/100 (7.73) Exif:CompressedBitsPerPixel: 30/10 (3) @@ -258,6 +264,8 @@ Orientation: 1 (normal) PixelAspectRatio: 1 Software: "Ver.1.00 " + thumbnail_height: 4032 + thumbnail_width: 6048 Exif:ApertureValue: 4.97085 (f/5.6) Exif:Contrast: 0 (normal) Exif:CustomRendered: 0 (no) @@ -351,6 +359,8 @@ Orientation: 1 (normal) PixelAspectRatio: 1 Software: "Version 1.0 " + thumbnail_height: 1200 + thumbnail_width: 1600 Exif:ApertureValue: 2 (f/2.0) Exif:Contrast: 0 (normal) Exif:CustomRendered: 1 (yes) @@ -422,6 +432,8 @@ Model: "DMC-G1" Orientation: 1 (normal) PixelAspectRatio: 1 + thumbnail_height: 1440 + thumbnail_width: 1920 Exif:ApertureValue: 5.3107 (f/6.3) Exif:DateTimeDigitized: "2008:12:10 15:06:33" Exif:DateTimeOriginal: "2008:12:10 15:06:33" @@ -463,6 +475,8 @@ Orientation: 1 (normal) PixelAspectRatio: 1 Software: "K200D Ver 1.00 " + thumbnail_height: 2592 + thumbnail_width: 3872 Exif:ApertureValue: 6 (f/8.0) Exif:Contrast: 0 (normal) Exif:CustomRendered: 0 (no) @@ -531,6 +545,8 @@ Orientation: 1 (normal) PixelAspectRatio: 1 Software: "DSLR-A300 v1.00" + thumbnail_height: 1080 + thumbnail_width: 1616 Exif:ApertureValue: 4.97085 (f/5.6) Exif:BrightnessValue: 137/100 (1.37) Exif:CompressedBitsPerPixel: 8/1 (8) diff --git a/testsuite/raw/ref/out-libraw0.21.0-gh.txt b/testsuite/raw/ref/out-libraw0.21.0-gh.txt index e0afdb021a..e8ca649833 100644 --- a/testsuite/raw/ref/out-libraw0.21.0-gh.txt +++ b/testsuite/raw/ref/out-libraw0.21.0-gh.txt @@ -10,6 +10,8 @@ Orientation: 1 (normal) PixelAspectRatio: 1 Software: "Firmware Version 1.0.7" + thumbnail_height: 3456 + thumbnail_width: 5184 Canon:AESetting: 0 (normal AE) Canon:AFPoint: 0 Canon:AverageBlackLevel: 2047 @@ -93,6 +95,8 @@ Orientation: 1 (normal) PixelAspectRatio: 1 Software: "Ver.1.00 " + thumbnail_height: 4032 + thumbnail_width: 6048 Exif:ApertureValue: 4.97085 (f/5.6) Exif:Contrast: 0 (normal) Exif:CustomRendered: 0 (no) @@ -181,6 +185,8 @@ Orientation: 1 (normal) PixelAspectRatio: 1 Software: "Digital Camera FinePix F700 Ver2.00" + thumbnail_height: 960 + thumbnail_width: 1280 Exif:ApertureValue: 3.69599 (f/3.6) Exif:BrightnessValue: 773/100 (7.73) Exif:CompressedBitsPerPixel: 30/10 (3) @@ -253,6 +259,8 @@ Orientation: 1 (normal) PixelAspectRatio: 1 Software: "Ver.1.00 " + thumbnail_height: 4032 + thumbnail_width: 6048 Exif:ApertureValue: 4.97085 (f/5.6) Exif:Contrast: 0 (normal) Exif:CustomRendered: 0 (no) @@ -344,6 +352,8 @@ Orientation: 1 (normal) PixelAspectRatio: 1 Software: "Version 1.0 " + thumbnail_height: 1200 + thumbnail_width: 1600 Exif:ApertureValue: 2 (f/2.0) Exif:Contrast: 0 (normal) Exif:CustomRendered: 1 (yes) @@ -418,6 +428,8 @@ Orientation: 1 (normal) PixelAspectRatio: 1 Software: "K200D Ver 1.00 " + thumbnail_height: 2592 + thumbnail_width: 3872 Exif:ApertureValue: 6 (f/8.0) Exif:Contrast: 0 (normal) Exif:CustomRendered: 0 (no) @@ -487,6 +499,8 @@ Orientation: 1 (normal) PixelAspectRatio: 1 Software: "DSLR-A300 v1.00" + thumbnail_height: 1080 + thumbnail_width: 1616 Exif:ApertureValue: 4.97085 (f/5.6) Exif:BrightnessValue: 137/100 (1.37) Exif:CompressedBitsPerPixel: 8/1 (8) diff --git a/testsuite/raw/ref/out-libraw0.21.0-mac.txt b/testsuite/raw/ref/out-libraw0.21.0-mac.txt index 76ba8ad88b..b0be9ee7cb 100644 --- a/testsuite/raw/ref/out-libraw0.21.0-mac.txt +++ b/testsuite/raw/ref/out-libraw0.21.0-mac.txt @@ -10,6 +10,8 @@ Orientation: 1 (normal) PixelAspectRatio: 1 Software: "Firmware Version 1.0.7" + thumbnail_height: 3456 + thumbnail_width: 5184 Canon:AESetting: 0 (normal AE) Canon:AFPoint: 0 Canon:AverageBlackLevel: 2047 @@ -93,6 +95,8 @@ Orientation: 1 (normal) PixelAspectRatio: 1 Software: "Ver.1.00 " + thumbnail_height: 4032 + thumbnail_width: 6048 Exif:ApertureValue: 4.97085 (f/5.6) Exif:Contrast: 0 (normal) Exif:CustomRendered: 0 (no) @@ -181,6 +185,8 @@ Orientation: 1 (normal) PixelAspectRatio: 1 Software: "Digital Camera FinePix F700 Ver2.00" + thumbnail_height: 960 + thumbnail_width: 1280 Exif:ApertureValue: 3.69599 (f/3.6) Exif:BrightnessValue: 773/100 (7.73) Exif:CompressedBitsPerPixel: 30/10 (3) @@ -253,6 +259,8 @@ Orientation: 1 (normal) PixelAspectRatio: 1 Software: "Ver.1.00 " + thumbnail_height: 4032 + thumbnail_width: 6048 Exif:ApertureValue: 4.97085 (f/5.6) Exif:Contrast: 0 (normal) Exif:CustomRendered: 0 (no) @@ -344,6 +352,8 @@ Orientation: 1 (normal) PixelAspectRatio: 1 Software: "Version 1.0 " + thumbnail_height: 1200 + thumbnail_width: 1600 Exif:ApertureValue: 2 (f/2.0) Exif:Contrast: 0 (normal) Exif:CustomRendered: 1 (yes) @@ -417,6 +427,8 @@ Model: "DMC-G1" Orientation: 1 (normal) PixelAspectRatio: 1 + thumbnail_height: 1440 + thumbnail_width: 1920 Exif:ApertureValue: 5.3107 (f/6.3) Exif:DateTimeDigitized: "2008:12:10 15:06:33" Exif:DateTimeOriginal: "2008:12:10 15:06:33" @@ -459,6 +471,8 @@ Orientation: 1 (normal) PixelAspectRatio: 1 Software: "K200D Ver 1.00 " + thumbnail_height: 2592 + thumbnail_width: 3872 Exif:ApertureValue: 6 (f/8.0) Exif:Contrast: 0 (normal) Exif:CustomRendered: 0 (no) @@ -528,6 +542,8 @@ Orientation: 1 (normal) PixelAspectRatio: 1 Software: "DSLR-A300 v1.00" + thumbnail_height: 1080 + thumbnail_width: 1616 Exif:ApertureValue: 4.97085 (f/5.6) Exif:BrightnessValue: 137/100 (1.37) Exif:CompressedBitsPerPixel: 8/1 (8) diff --git a/testsuite/raw/ref/out.txt b/testsuite/raw/ref/out.txt index d29bc262d1..8288cee578 100644 --- a/testsuite/raw/ref/out.txt +++ b/testsuite/raw/ref/out.txt @@ -10,6 +10,8 @@ Orientation: 1 (normal) PixelAspectRatio: 1 Software: "Firmware Version 1.0.7" + thumbnail_height: 3456 + thumbnail_width: 5184 Canon:AESetting: 0 (normal AE) Canon:AFAreaMode: 0 Canon:AFPoint: 0 @@ -95,6 +97,8 @@ Orientation: 1 (normal) PixelAspectRatio: 1 Software: "Ver.1.00 " + thumbnail_height: 4032 + thumbnail_width: 6048 Exif:ApertureValue: 4.97085 (f/5.6) Exif:Contrast: 0 (normal) Exif:CustomRendered: 0 (no) @@ -186,6 +190,8 @@ Orientation: 1 (normal) PixelAspectRatio: 1 Software: "Digital Camera FinePix F700 Ver2.00" + thumbnail_height: 960 + thumbnail_width: 1280 Exif:ApertureValue: 3.69599 (f/3.6) Exif:BrightnessValue: 773/100 (7.73) Exif:CompressedBitsPerPixel: 30/10 (3) @@ -257,6 +263,8 @@ Orientation: 1 (normal) PixelAspectRatio: 1 Software: "Ver.1.00 " + thumbnail_height: 4032 + thumbnail_width: 6048 Exif:ApertureValue: 4.97085 (f/5.6) Exif:Contrast: 0 (normal) Exif:CustomRendered: 0 (no) @@ -351,6 +359,8 @@ Orientation: 1 (normal) PixelAspectRatio: 1 Software: "Version 1.0 " + thumbnail_height: 1200 + thumbnail_width: 1600 Exif:ApertureValue: 2 (f/2.0) Exif:Contrast: 0 (normal) Exif:CustomRendered: 1 (yes) @@ -422,6 +432,8 @@ Model: "DMC-G1" Orientation: 1 (normal) PixelAspectRatio: 1 + thumbnail_height: 1440 + thumbnail_width: 1920 Exif:ApertureValue: 5.3107 (f/6.3) Exif:DateTimeDigitized: "2008:12:10 15:06:33" Exif:DateTimeOriginal: "2008:12:10 15:06:33" @@ -459,6 +471,8 @@ Orientation: 1 (normal) PixelAspectRatio: 1 Software: "K200D Ver 1.00 " + thumbnail_height: 2592 + thumbnail_width: 3872 Exif:ApertureValue: 6 (f/8.0) Exif:Contrast: 0 (normal) Exif:CustomRendered: 0 (no) @@ -528,6 +542,8 @@ Orientation: 1 (normal) PixelAspectRatio: 1 Software: "DSLR-A300 v1.00" + thumbnail_height: 1080 + thumbnail_width: 1616 Exif:ApertureValue: 4.97085 (f/5.6) Exif:BrightnessValue: 137/100 (1.37) Exif:CompressedBitsPerPixel: 8/1 (8)