private PhotonFile ReadFile(byte[] file, Action <string> reportProgress) { reportProgress?.Invoke("Reading Photon file header information..."); var photonFileHeader = new PhotonFileHeader(file); iFileHeader = photonFileHeader; reportProgress?.Invoke("Reading photon large preview image information..."); previewOne = new PhotonFilePreview(photonFileHeader.GetPreviewOneOffsetAddress(), file); reportProgress?.Invoke("Reading photon small preview image information..."); previewTwo = new PhotonFilePreview(photonFileHeader.GetPreviewTwoOffsetAddress(), file); if (photonFileHeader.GetVersion() > 1) { reportProgress?.Invoke("Reading Print parameters information..."); photonFileHeader.ReadParameters(file); } reportProgress?.Invoke("Reading photon layers information..."); layers = PhotonFileLayer.ReadLayers(photonFileHeader, file, margin, reportProgress); ResetMarginAndIslandInfo(); return(this); }