                 
                 if let _fctl = fctl {
                     frames.append(Frame(prev_frame: frames.last, chunks: chunks, ihdr: ihdr, fctl: _fctl, data: data))
-                    fctl = nil
                     data = Data()
                 }
                 

    }
    
    var numberOfPages: Int {
        return frames.count
    }
    
    func page(_ index: Int) -> ImageRepBase {

                
            case "IDAT":
                
                guard actl != nil, fctl != nil, frames.last == nil else { return }
                
                data = self.idat
                
            case "fdAT":
                
                guard actl != nil, fctl != nil else { return }
                guard chunk.data.count >= 4 else { return }
                
                let data_chunk = FrameDataChunk(data: chunk.data)
