Hello,
I have an image with Tga format and when I use ImageReader, I get the following exception: "The media format is not supported."... However if I use TgaReader, it works fine.
I would like to use ImageReader.Create() to see which extension the image has..
Stack Trace:
at Aurigma.GraphicsMill.Codecs.CodecsRegistry.CreateReader(FileFormat format, Object source)
at Aurigma.GraphicsMill.Codecs.ImageReader.Create(Stream stream)
at ImageProcessor.ManualTests.Program.ReadTga() in d:\code\projects\ImageProcessor\ImageProcessor.ManualTests\Program.cs:line 57
at ImageProcessor.ManualTests.Program.Main(String[] args) in d:\code\projects\ImageProcessor\ImageProcessor.ManualTests\Program.cs:line 50
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
Code used to create tga image:
Code:private static void WriteTga()
{
using (var bitmap = new Bitmap(@"D:\img.jpg"))
{
bitmap.Transforms.Flip(FlipType.Vertical);
bitmap.Save(@"D:\out.tga");
}
}
Code used to read the image:
Code:private static void ReadTga()
{
var media = File.ReadAllBytes(@"D:\out.tga");
using (var reader = ImageReader.Create(new MemoryStream(media)))
using (var writer = new TgaWriter(@"D:\out.tga2"))
{
writer.Compression = CompressionType.Rle;
writer.ReducedPrecision = true;
Pipeline.Run(reader + writer);
}
}
Edited by user Wednesday, January 27, 2016 9:28:53 AM(UTC)
| Reason: Not specified