Open ghost opened 7 years ago
@mellinoe can you help get the run to 100% green, even if it means disabling tests?
These three MonoTests.System.Drawing.Imaging.PngCodecTest tests failed again here with the same error: https://mc.dot.net/#/user/Drawaes/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/d983ece4b9431f65637b46081e9bf7c46c02c348/workItem/System.Drawing.Common.Tests
Bitmap2bitData
Bitmap2bitFeatures
Bitmap2bitPixels
And a bunch of PngCodecTests failed here with the same error: https://mc.dot.net/#/user/Drawaes/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/7a132a4d2694413bab5762b7af6ef5606c7b8724/workItem/System.Drawing.Common.Tests
Bitmap1bitFeatures
Bitmap1bitPixels
Bitmap2bitData
Bitmap2bitFeatures
Bitmap2bitPixels
Bitmap4bitFeatures
Bitmap4bitPixels
@qmfrederik do you have any context on these failures?
BTW, @safern is the new owner of drawing: @mellinoe has left to pursue a new project.
@danmosemsft It's most likely because of an old version of libgdiplus on the CI boxes it's failing on. I've left a note on dotnet/corefx#24545.
I am actually running into this issue in my software on Linux (https://github.com/SteamDatabase/ValveResourceFormat/issues/94). I'm on debian 9 with libgdiplus 4.2-1+b1 installed.
I am running into what I believe is the same issue. Running it on windows it works fine but running it on linux or using WSL it fails. I have attached the gif file that is failing, another failing gif and two other gif file that are working. I looked at the first 6 bytes of the files that are not working and they appear to be valid.
static void Main(string[] args)
{
string imageName = "no_harley.gif";
string path = $"/{Path.Combine("mnt", "c", "_Source", "LinuxConsoleApp", "LinuxConsoleApp")}";
string combined = Path.Combine(path, imageName);
//FromFile fails with a "Parameter is not valid." error
using (System.Drawing.Image image = System.Drawing.Image.FromFile(combined))
{
if (image.RawFormat.Guid == System.Drawing.Imaging.ImageFormat.Gif.Guid ||
image.RawFormat.Guid == System.Drawing.Imaging.ImageFormat.Jpeg.Guid ||
image.RawFormat.Guid == System.Drawing.Imaging.ImageFormat.Png.Guid
)
{
//Valid
Console.WriteLine("File is valid");
}
else
{
throw new Exception($"{"Bad File Format"}(raw format guid: {image.RawFormat.Guid})");
}
}
}
//Failing //Working
@decherneyge which version of libgdiplus is being used?
@decherneyge which version of libgdiplus is being used?
@safern 4.2-2
@decherneyge 4.2 is about 5 years old.
Can you try to use version 6.x of libgdiplus or git master, and see whether the problem reproduces?
@qmfrederik mind pointing me in the direction of some instructions on how to install 6.x ? When I use apt-get it says I have the latest (4.2-2)
$ sudo apt-get install -y libgdiplus Reading package lists... Done Building dependency tree Reading state information... Done libgdiplus is already the newest version (4.2-2).
Mono hosts Debian/Ubuntu repositories which have libgdiplus 6.x. You can find instructions on how to add these repositories at https://www.mono-project.com/download/stable/#download-lin .
You don't need to install Mono, only libgdiplus.
Ubuntu 20.04 should be the first Ubuntu version to ship with libgdiplus 6.x.
@qmfrederik thanks! I got 6.0.4 installed and the invalid parameter error is now gone. I am running into an out of memory error but as that is different I will investigate separately.
@qmfrederik I'm facing the same issue on a containerized netcore service, I would like to try installing the package v 6.0.4 but I get E: Version '6.0.4' for 'libgdiplus' was not found
my Dockerfile runsfollowing command:
RUN apt-get update \ && apt-get -y install curl \ && apt-get install -y libgdiplus=6.0.4
I'd appreciate your help.
thanks
Are you on Ubuntu Bionic or Debian Bullseye or newer? Older version of Debian/Ubuntu ship with outdated libgdiplus versions. Alternatively, you can fetch libgdiplus from the Mono apt repositories - see https://www.mono-project.com/download/stable/#download-lin
It seems that my base image is using 18.04 (Bionic) so it won't find a newer version than 4.2-2.
I tried but I'm not able to force the apt-get install command to look into mono apt repo, so that it installs libgdiplus=6.0.4
thanks in advance.
So I managed to upgrade to libgdiplus 6.0.4 but the error persists. It happens in the constructor of the Bitmap object, when I pass a string referencing the location of a .bmp file, I tried with a different .bmp and it works, I also made sure that the first .bmp exists.
apart from that I have no idea what else to try.
I appreciate your insights. thanks.
Opened on behalf of @Jiayili1
The test
MonoTests.System.Drawing.Imaging.PngCodecTest/Bitmap2bitData
has failed.System.ArgumentException : Parameter is not valid.
Build : Master - 20170930.01 (Core Tests) Failing configurations:
Detail: https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20170930.01/workItem/System.Drawing.Common.Tests/analysis/xunit/MonoTests.System.Drawing.Imaging.PngCodecTest~2FBitmap2bitData