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

Minor fix on save extra AOVs (originally #1865) #1880

Merged
merged 2 commits into from
Mar 5, 2018
Merged
Changes from 1 commit
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
8 changes: 4 additions & 4 deletions src/appleseed/renderer/modeling/frame/frame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,7 @@ namespace
{
bool success = true;

if (extension != ".exr")
if (extension != ".exr" && extension != ".EXR")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's not robust enough (wouldn't work with ".Exr" for instance). I suggest converting the extension to lower case before doing the check.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, then we should also do that in write_image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's already properly done in write_image():

string extension = lower_case(bf_file_path.extension().string());

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That said, the problem appears to also exist in write_main_image(), maybe that's what you meant.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No it wasn't, I haven't seen the lower_case code. But thanks for pointing out this, I will fix that

{
RENDERER_LOG_ERROR("extra AOVs can only be saved as exr.");
return false;
Expand All @@ -717,7 +717,7 @@ namespace
const size_t image_index = aov_indices[i];
assert(image_index < images.size());

const Image & image = images.get_image(image_index);
const Image& image = images.get_image(image_index);

// Compute image file path.
const string aov_name = images.get_name(image_index);
Expand Down Expand Up @@ -785,7 +785,7 @@ bool Frame::write_aov_images(const char* file_path) const
success = false;
}

if (impl->m_save_extra_aovs && !aov_images().empty())
if (impl->m_save_extra_aovs)
{
success = success && write_extra_aovs(
aov_images(),
Expand Down Expand Up @@ -896,7 +896,7 @@ void Frame::write_main_and_aov_images_to_multipart_exr(const char* file_path) co
const size_t image_index = impl->m_extra_aovs[i];
assert(image_index < aov_images().size());

const Image & image = aov_images().get_image(image_index);
const Image& image = aov_images().get_image(image_index);
const CanvasProperties& props = image.properties();
const string aov_name = aov_images().get_name(image_index);
assert(props.m_channel_count == 4);
Expand Down