question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

GDI error when saving large PNG files

See original GitHub issue

hi,

didnt find any reference to this

[00:30:28]F:				 [FTC_3567.Performance_ImportShape_20_1_ENU_DEFAULT.MacroExec] FTC_3567.FatalException
[00:30:28] :					 [FTC_3567.FatalException]   10/03/2020 0.30.28 : RecordFailure: FTC_3567.FatalException => Testware Failure: A generic error occurred in GDI+. => sStackTrakce: =>    at System.Drawing.Image.Save(String filename, ImageCodecInfo encoder, EncoderParameters encoderParams)
[00:30:28] :					 [FTC_3567.FatalException]      at System.Drawing.Image.Save(String filename, ImageFormat format)
[00:30:28] :					 [FTC_3567.FatalException]      at ScottPlot.Plot.SaveFig(String filePath, Boolean renderFirst)
[00:30:28] :					 [FTC_3567.FatalException]      at TafSdk.Performance.PerfMonitor.AnalyseAndPlotData(KeyValuePair`2 currentRunMeasures, IMessageLogger logger, String perfModelFolder, String refModelFolder, String runPerFileName, TestManager testManager) in E:/prod/ts-build/Test/TestTools/TestAdapters/TafSdk/Performance/PerfMonitor.cs:line 355
[00:30:28] :					 [FTC_3567.FatalException]      at TafSdk.Performance.PerfMonitor.ProcessDataAndSave(String ftcCaseName, String caseId, String modelPath, String refModelFolder, IMessageLogger logger, TestManager testManager) in E:/prod/ts-build/Test/TestTools/TestAdapters/TafSdk/Performance/PerfMonitor.cs:line 132
[00:30:28] :					 [FTC_3567.FatalException]      at FarmiAdapterUtils.FarmiModelHelpers.<RunMacrosAgainstModel>d__64.MoveNext() in E:/prod/ts-build/Test/TestTools/TestAdapters/FarmiAdapterUtils/FarmiModelHelpers.cs:line 3212
[00:30:28] :					 [FTC_3567.FatalException]   --- End of stack trace from previous location where exception was thrown ---
[00:30:28] :					 [FTC_3567.FatalException]      at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
[00:30:28] :					 [FTC_3567.FatalException]      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
[00:30:28] :					 [FTC_3567.FatalException]      at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
[00:30:28] :					 [FTC_3567.FatalException]      at FarmiAdapterUtils.FarmiModelHelpers.<RunTafTestCase>d__17.MoveNext() in E:/prod/ts-build/Test/TestTools/TestAdapters/FarmiAdapterUtils/FarmiModelHelpers.cs:line 956
[00:30:28] :					 [FTC_3567.FatalException]   --- End of stack trace from previous location where exception was thrown ---
[00:30:28] :					 [FTC_3567.FatalException]      at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
[00:30:28] :					 [FTC_3567.FatalException]      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
[00:30:28] :					 [FTC_3567.FatalException]      at FarmiAdapterUtils.FarmiModelHelpers.<RunCases>d__14.MoveNext() in E:/prod/ts-build/Test/TestTools/TestAdapters/FarmiAdapterUtils/FarmiModelHelpers.cs:line 510
[00:30:28] :					 [FTC_3567.FatalException]   10/03/2020 0.30.28 : teamcity[testFailed name='FTC_3567.FatalException' message='The following error messages were found :|nStackTrakce: =>    at System.Drawing.Image.Save(String filename, ImageCodecInfo encoder, EncoderParameters encoderParams)|r|n   at System.Drawing.Image.Save(String filename, ImageFormat format)|r|n   at ScottPlot.Plot.SaveFig(String filePath, Boolean renderFirst)|r|n   at TafSdk.Performance.PerfMonitor.AnalyseAndPlotData(KeyValuePair`2 currentRunMeasures, IMessageLogger logger, String perfModelFolder, String refModelFolder, String runPerFileName, TestManager testManager) in E:/prod/ts-build/Test/TestTools/TestAdapters/TafSdk/Performance/PerfMonitor.cs:line 355|r|n   at TafSdk.Performance.PerfMonitor.ProcessDataAndSave(String ftcCaseName, String caseId, String modelPath, String refModelFolder, IMessageLogger logger, TestManager testManager) in E:/prod/ts-build/Test/TestTools/TestAdapters/TafSdk/Performance/PerfMonitor.cs:line 132|r|n   at FarmiAdapterUtils.FarmiModelHelpers.<RunMacrosAgainstModel>d__64.MoveNext() in E:/prod/ts-build/Test/TestTools/TestAdapters/FarmiAdapterUtils/FarmiModelHelpers.cs:line 3212|r|n--- End of stack trace from previous location where exception was thrown ---|r|n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)|r|n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)|r|n   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)|r|n   at FarmiAdapterUtils.FarmiModelHelpers.<RunTafTestCase>d__17.MoveNext() in E:/prod/ts-build/Test/TestTools/TestAdapters/FarmiAdapterUtils/FarmiModelHelpers.cs:line 956|r|n--- End of stack trace from previous location where exception was thrown ---|r|n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)|r|n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)|r|n   at FarmiAdapterUtils.FarmiModelHelpers.<RunCases>d__14.MoveNext() in E:/prod/ts-build/Test/TestTools/TestAdapters/FarmiAdapterUtils/FarmiModelHelpers.cs:line 510' details='Testware Failure: A generic error occurred in GDI+.']
[00:30:28] :					 [FTC_3567.FatalException]   10/03/2020 0.30.28 : 

Can it be the size of the png being 2 big?

var plt = new ScottPlot.Plot(2000, 1000);

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
swhardencommented, Mar 10, 2020

I would say its most likely the data set that is causing the issue.

Sounds good! I’ll close this issue for now, but if you find that ScottPlot is the underlying cause feel free to open the issue again (perhaps with sample data that causes crashes) and I can take a closer look.

I’m glad you enjoy using ScottPlot! Good luck with your coding 👍

0reactions
jmecostacommented, Mar 10, 2020

it occurrs in a some tests! doesnt seem to be related with agent since others tests run fine in that agent! i would say its most likely the data set that is causing the issue. i will do what u suggested and let u know if it works. thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

GDI+ exception when saving image in PNG format
An ASP.NET application on my server starts throwing GDI+ exception after running for several days. After I restart the server, all works fine ......
Read more >
.NET GDI+ Error when saving large files in formats other ...
I am working on a program which composts some images together and ends up with a large working set for a time (final...
Read more >
Bitmap.Save(): A Generic Error Occurred in GDI+
Save(): A Generic Error Occurred in GDI+" can be fixed by 3 ways. Either save as new file or create new object and...
Read more >
C# Bitmap Save Generic GDI+ Error
It means that the file path points to an image that has already been opened in GDI+. You need to be careful to...
Read more >
Thread: My.Resource.<bitmap>.Save Causes GDI+ Error
I'm having an issue where when I call the following code: My.Resource. .Save( , Imaging.ImageFormat.Png) That it is giving me the error: But ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found