public ImportedImage ImportImage(StreamReaderHelper stream, PdfDocument document) { try { stream.CurrentOffset = 0; int offsetImageData; if (TestBitmapFileHeader(stream, out offsetImageData)) { // Magic: TestBitmapFileHeader updates stream.CurrentOffset on success. ImagePrivateDataBitmap ipd = new ImagePrivateDataBitmap(stream.Data, stream.Length); ImportedImage ii = new ImportedImageBitmap(this, ipd, document); if (TestBitmapInfoHeader(stream, ii, offsetImageData)) { //stream.CurrentOffset = offsetImageData; return(ii); } } } // ReSharper disable once EmptyGeneralCatchClause catch { } return(null); }
public ImportedImage ImportImage(StreamReaderHelper stream, PdfDocument document) { try { stream.CurrentOffset = 0; int offsetImageData; if (TestBitmapFileHeader(stream, out offsetImageData)) { // Magic: TestBitmapFileHeader updates stream.CurrentOffset on success. ImagePrivateDataBitmap ipd = new ImagePrivateDataBitmap(stream.Data, stream.Length); ImportedImage ii = new ImportedImageBitmap(this, ipd, document); if (TestBitmapInfoHeader(stream, ii, offsetImageData)) { //stream.CurrentOffset = offsetImageData; return ii; } } } // ReSharper disable once EmptyGeneralCatchClause catch (Exception) { } return null; }