chunk data is too large
chunk data is too large
Getting this error when trying to resize large tif image. vs 2015 installed Magick.NET 7.5.0.1 as I read that this issue was fixed in one of the releases. Any help is appreciated.
Re: chunk data is too large
Could you add a small sample and share the input image on something like onedrive or dropbox so I can reproduce his?
Re: chunk data is too large
https://drive.google.com/open?id=1Lmu2L ... XF2OUWfcuA
Please let me know if you can get to this image.
Thanks for looking into this!
Please let me know if you can get to this image.
Thanks for looking into this!
Re: chunk data is too large
I have the image and I can read it without any issues. Can you also post a small code sample that I can use to reproduce the issue?
Re: chunk data is too large
Code: Select all
public byte[] GenerateThumbnail(byte[] fileData, string extention)
{
if (fileData == null || fileData.Length == 0)
{
EventLogProvider.LogEvent("E", "ThumbnailProvider", "GENERATETHUMBNAIL", $"Data for creating thumbnail is empty");
return null;
}
byte[] generatedThumbnail = null;
var format = MagickFormat.Unknown;
if(!Enum.TryParse(extention, true, out format))
{
throw new InvalidDataException($"Unrecognized format: {extention}");
}
using (var image = new MagickImage(fileData, new MagickReadSettings { Format = format }))
{
image.Resize(new MagickGeometry(200) { IgnoreAspectRatio = false, Greater = true, Less = false, FillArea = false });
image.Format = _defaultOutputFormat;
generatedThumbnail = image.ToByteArray();
}
break;
generatedThumbnail = CompressThumbnail(generatedThumbnail);
return generatedThumbnail;
}
Re: chunk data is too large
And the value of extension is?
Re: chunk data is too large
It is tif as we are trying to resize the image that I send you the link for. Here is the code to extract that extension
var extension = file.FileName;
extension = Path.GetExtension(extension).TrimStart('.');
var extension = file.FileName;
extension = Path.GetExtension(extension).TrimStart('.');
Re: chunk data is too large
And can you explain at which moment you get that exception?
Re: chunk data is too large
I am getting exception at the following line. Sorry I thought I mentioned that it happens on resize.
image.Resize(new MagickGeometry(200) { IgnoreAspectRatio = false, Greater = true, Less = false, FillArea = false });
image.Resize(new MagickGeometry(200) { IgnoreAspectRatio = false, Greater = true, Less = false, FillArea = false });
Re: chunk data is too large
I just did a search for the text `chunk data is too large` in the code of ImageMagick and it turns out that this only will happen when a .PNG file is being read. I have no clue how I can reproduce your issue with the image and the sample code that you provided.
Re: chunk data is too large
I was trying to send multiple files so I posted one of them. Below is the png file so you can troubleshoot this. Please let me know if you can access it.
https://drive.google.com/open?id=1QP6RV ... 7DEiHyHb0x
https://drive.google.com/open?id=1QP6RV ... 7DEiHyHb0x