public static FileHeaderSection FromFile(string filename) { using (FileStream stream = new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.Read)) using (PsdReader reader = new PsdReader(stream, new PathResolver(), new Uri(Path.GetDirectoryName(filename)))) { reader.ReadDocumentHeader(); return(FileHeaderSectionReader.Read(reader)); } }
internal void Read(Stream stream, PsdResolver resolver, Uri uri) { this.reader = new PsdReader(stream, resolver, uri); this.reader.ReadDocumentHeader(); this.fileHeaderSection = new FileHeaderSectionReader(this.reader); this.colorModeDataSection = new ColorModeDataSectionReader(this.reader); this.imageResourcesSection = new ImageResourcesSectionReader(this.reader); this.layerAndMaskSection = new LayerAndMaskInformationSectionReader(this.reader, this); this.imageDataSection = new ImageDataSectionReader(this.reader, this); }
public override void ReadValue(PsdReader reader, object userData, out FileHeaderSection value) { if (this.IsDocument(reader) == true) { using (Stream stream = new RangeStream(reader.Stream, reader.Position, this.Length)) using (PsdReader r = new PsdReader(stream, reader.Resolver, reader.Uri)) { r.ReadDocumentHeader(); value = FileHeaderSectionReader.Read(r); } } else { value = new FileHeaderSection(); } }
internal void Read(Stream stream, PsdResolver resolver, Uri uri) { this.reader = new PsdReader(stream, resolver, uri); this.reader.ReadDocumentHeader(); this.fileHeaderSection = new FileHeaderSectionReader(this.reader); this.colorModeDataSection = new ColorModeDataSectionReader(this.reader); this.imageResourcesSection = new ImageResourcesSectionReader(this.reader); this.layerAndMaskSection = new LayerAndMaskInformationSectionReader(this.reader, this); this.imageDataSection = new ImageDataSectionReader(this.reader, this); }