-
Notifications
You must be signed in to change notification settings - Fork 296
Changes to support OpenEXR 3.0. #422
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -46,21 +46,11 @@ | |
|
|
||
| #ifndef OPENEXR_MISSING | ||
|
|
||
| #ifdef NON_UNIX_OPENEXR_HEADERS | ||
|
|
||
| #include <ImfRgbaFile.h> | ||
| #include <ImfStringAttribute.h> | ||
| #include <ImfMatrixAttribute.h> | ||
| #include <ImfArray.h> | ||
|
|
||
| #else | ||
|
|
||
| #include <OpenEXR/ImfRgbaFile.h> | ||
| #include <OpenEXR/ImfStringAttribute.h> | ||
| #include <OpenEXR/ImfMatrixAttribute.h> | ||
| #include <OpenEXR/ImfArray.h> | ||
|
|
||
| #endif | ||
| #include "metadata.h" | ||
|
|
||
| // this must be the last file included | ||
|
|
@@ -78,6 +68,11 @@ using namespace Imath; | |
| /***************************************************************************** | ||
| * Local preprocessor defines | ||
| ******************************************************************************/ | ||
| #if (OPENEXR_VERSION_MAJOR < 3) | ||
| #define OPENEXR_INT64 Int64 | ||
| #else | ||
| #define OPENEXR_INT64 uint64_t | ||
| #endif | ||
|
|
||
| /***************************************************************************** | ||
| * Local typedefs | ||
|
|
@@ -105,17 +100,17 @@ class POV_EXR_OStream : public Imf::OStream | |
| throw POV_EXCEPTION(kFileDataErr, "Error while writing EXR output"); | ||
| } | ||
|
|
||
| Int64 tellp() | ||
| OPENEXR_INT64 tellp() | ||
| { | ||
| unsigned long pos = os.tellg(); | ||
| POV_LONG pos = os.tellg(); | ||
| if((int) pos == -1) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. While you're at it, all Same goes for the comparison with -1 here and further below: There's a bug lurking in there as well, and it should instead be something like |
||
| throw POV_EXCEPTION(kFileDataErr, "Error while writing EXR output"); | ||
| return(pos); | ||
| } | ||
|
|
||
| void seekp(Int64 pos) | ||
| void seekp(OPENEXR_INT64 pos) | ||
| { | ||
| if(!os.seekg((unsigned long)pos)) | ||
| if(!os.seekg((POV_LONG)pos)) | ||
| throw POV_EXCEPTION(kFileDataErr, "Error when writing EXR output"); | ||
| } | ||
| private: | ||
|
|
@@ -147,22 +142,22 @@ class POV_EXR_IStream : public Imf::IStream | |
| return (is.tellg() < fsize); | ||
| } | ||
|
|
||
| Int64 tellg() | ||
| OPENEXR_INT64 tellg() | ||
| { | ||
| unsigned long pos = is.tellg(); | ||
| POV_LONG pos = is.tellg(); | ||
| if((int)pos == -1) | ||
| throw POV_EXCEPTION(kFileDataErr, "Error while reading EXR file"); | ||
| return pos; | ||
| } | ||
|
|
||
| void seekg(Int64 pos) | ||
| void seekg(OPENEXR_INT64 pos) | ||
| { | ||
| if(!is.seekg((unsigned long)pos)) | ||
| if(!is.seekg((POV_LONG)pos)) | ||
| throw POV_EXCEPTION(kFileDataErr, "Error while reading EXR file"); | ||
| } | ||
| private: | ||
| pov_base::IStream& is; | ||
| unsigned long fsize; | ||
| POV_LONG fsize; | ||
| }; | ||
|
|
||
| /***************************************************************************** | ||
|
|
@@ -282,7 +277,7 @@ void Write(OStream *file, const Image *image, const Image::WriteOptions& options | |
| comments += meta.getComment3() + "\n"; | ||
| if (!meta.getComment4().empty()) | ||
| comments += meta.getComment4() + "\n"; | ||
|
|
||
| if (!comments.empty()) | ||
| hdr.insert("comments",StringAttribute(comments.c_str())); | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.