1#!/usr/bin/env python
2
3from __future__ import absolute_import
4import os
5
6files = [ "RAW_CANON_EOS_7D.CR2",
7          "RAW_NIKON_D3X.NEF",
8          "RAW_FUJI_F700.RAF",
9          "RAW_NIKON_D3X.NEF",
10          "RAW_OLYMPUS_E3.ORF",
11          "RAW_PANASONIC_G1.RW2",
12          "RAW_PENTAX_K200D.PEF",
13          "RAW_SONY_A300.ARW" ]
14outputs = []
15
16# Things vary a lot with libraw versions.
17# FIXME -- return to this later
18if (os.getenv('GITHUB_ACTIONS') == 'true'):
19    failthresh = 0.024
20    files.remove ("RAW_PANASONIC_G1.RW2")
21
22# Fairly high hard fail, since libraw seems to diddle with its debayering
23# from version to version, it's hard to make a single reference image.
24hardfail = 0.017
25
26# For each test image, read it and print all metadata, resize it (to make
27# the ref images small) and compared to the reference.
28for f in files:
29    outputname = f+".tif"
30    command += oiiotool ("-iconfig raw:ColorSpace linear "
31                         + "-i:info=2 " + OIIO_TESTSUITE_IMAGEDIR + "/" + f
32                         + " -resample '5%' -d uint8 "
33                         + "-o " + outputname)
34    outputs += [ outputname ]
35
36outputs += [ "out.txt" ]
37