---
title: "CodecRegistry.TryCreateReader Method "
canonical: https://www.graphicsmill.com/docs/gm/M_Aurigma_GraphicsMill_Codecs_CodecRegistry_TryCreateReader_1_bca7c9fe.htm
product: "Graphics Mill"
---

# CodecRegistry.TryCreateReader Method 
 
Creates an appropriate image reader for the specified stream, or returns `null` if the format cannot be recognized.
 
**Namespace:** [Aurigma.GraphicsMill.Codecs](https://www.graphicsmill.com/docs/gm/N_Aurigma_GraphicsMill_Codecs.htm.md)
 **Assembly:** Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
 
## Syntax
  
```csharp
public ImageReader TryCreateReader(Stream stream
)
```
 
### Parameters
 
 - stream
     - Type: System.IO.Stream
A Stream to create a reader for.
 
### Return Value
An [ImageReader](https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Codecs_ImageReader.htm.md) for the recognized format, or `null` if the format could not be recognized.
 
## Remarks
 Unlike [CreateReader(Stream)](https://www.graphicsmill.com/docs/gm/M_Aurigma_GraphicsMill_Codecs_CodecRegistry_CreateReader_1_bca7c9fe.htm.md), this method does not throw an exception when the format cannot be recognized, which makes it convenient for handling multiple files or user uploads of unknown format.
   
## See Also

### Reference

- [CodecRegistry Class](https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Codecs_CodecRegistry.htm.md)
- [Aurigma.GraphicsMill.Codecs Namespace](https://www.graphicsmill.com/docs/gm/N_Aurigma_GraphicsMill_Codecs.htm.md)
