~mbranton/libopenshot/alpha-channel-fix

« back to all changes in this revision

Viewing changes to src/ImageReader.cpp

  • Committer: Jonathan Thomas
  • Date: 2016-09-16 22:43:26 UTC
  • Revision ID: jonathan@openshot.org-20160916224326-0ca2uhoj7bhd51ou
Added a new optimized constructor to some readers (FFmpegReader, QtImageReader, ImageReader) to not Open() in the constructor, which dramatically speeds up creating hundreds of Readers (i.e. when opening a project). This is really only useful when inflating the reader with Json right after you instantiate it...

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
        Close();
37
37
}
38
38
 
 
39
ImageReader::ImageReader(string path, bool inspect_reader) throw(InvalidFile) : path(path), is_open(false)
 
40
{
 
41
        // Open and Close the reader, to populate it's attributes (such as height, width, etc...)
 
42
        if (inspect_reader) {
 
43
                Open();
 
44
                Close();
 
45
        }
 
46
}
 
47
 
39
48
// Open image file
40
49
void ImageReader::Open() throw(InvalidFile)
41
50
{