HEX
Server: nginx/1.24.0
System: Linux DGT-WORDPRESS-VM-SERVER 6.14.0-1014-azure #14~24.04.1-Ubuntu SMP Fri Oct 3 20:52:11 UTC 2025 x86_64
User: ubuntu (1000)
PHP: 8.4.12
Disabled: NONE
Upload Files
File: //usr/include/OpenEXR/ImfCheckFile.h
// SPDX-License-Identifier: BSD-3-Clause
// Copyright (c) Contributors to the OpenEXR Project.


#ifndef INCLUDED_IMF_CHECKFILE_H
#define INCLUDED_IMF_CHECKFILE_H

#include "ImfUtilExport.h"
#include "ImfNamespace.h"

#include <cstddef>

OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER


//
// attempt to read the given file as an OpenEXR, using various OpenEXR read paths.
// This can be used to validate correctness of the library, when running the library
// with a sanitizer or memory checker, as well as checking that a file is a correct OpenEXR
//
// returns true if the file reads correctly using expected API calls, or false
// if an exception was thrown that indicates the file is invalid
//
// if reduceMemory is true, will avoid tests or inputs that are known to
// take large amounts of memory. This may hide errors within the file or library.
//
// if reduceTime is true and an error is found within the file, then future tests are reduced for speed.
// This may hide errors within the library.
//
//

IMFUTIL_EXPORT bool
checkOpenEXRFile(const char* fileName,
                 bool reduceMemory  = false,
                 bool reduceTime = false,
                 bool enableCoreCheck = false
                );


//
// overloaded version of checkOpenEXRFile that takes a pointer to in-memory data
//

IMFUTIL_EXPORT bool
checkOpenEXRFile(const char* data,
                 size_t numBytes,
                 bool reduceMemory = false,
                 bool reduceTime = false,
                 bool enableCoreCheck = false
                );

OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT

#endif