X-Git-Url: https://git.cinelerra-gg.org/git/?p=goodguy%2Fcinelerra.git;a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Ffileexr.C;h=9c782a112f8340e8f62023c4398ead416be07c35;hp=fbc3986221a3658700feebe4fd8c61c1000718e2;hb=HEAD;hpb=02c179665199bb8bd1b057f83c26c070ce618901 diff --git a/cinelerra-5.1/cinelerra/fileexr.C b/cinelerra-5.1/cinelerra/fileexr.C index fbc39862..a705f6c8 100644 --- a/cinelerra-5.1/cinelerra/fileexr.C +++ b/cinelerra-5.1/cinelerra/fileexr.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -311,6 +312,9 @@ int FileEXR::read_frame_header(char *path) int FileEXR::read_frame(VFrame *frame, VFrame *data) { + + try { + Imf::setGlobalThreadCount(file->cpus); EXRIStream exr_stream((char*)data->get_data(), data->get_compressed_size()); Imf::InputFile file(exr_stream); @@ -425,6 +429,10 @@ int FileEXR::read_frame(VFrame *frame, VFrame *data) } } return 0; + } catch (const std::exception &e) { + std::cerr << "error reading EXR image file:" << e.what() << std::endl; + return 1; + } } @@ -506,6 +514,15 @@ int FileEXR::write_frame(VFrame *frame, VFrame *data, FrameWriterUnit *unit) return 0; } +int FileEXR::can_copy_from(Asset *asset, int64_t position) +{ + if(asset->format == FILE_EXR || + asset->format == FILE_EXR_LIST) + return 1; + + return 0; +} + FrameWriterUnit* FileEXR::new_writer_unit(FrameWriter *writer) { return new EXRUnit(this, writer);