Browse Source

Update errors and config

Former-commit-id: e623247db24cb728703e278cb7a548d6229b82ee
Former-commit-id: 37ac7c485921004e6f8ac613e32e1ff8f92bca61
Former-commit-id: 71b6e8c354b9c858872988329f1ede76a6e319d2
af/merge-core
James Jackson-South 10 years ago
parent
commit
20afe734da
  1. 10
      src/ImageProcessorCore/Formats/Png/PngDecoderCore.cs
  2. 9
      src/ImageProcessorCore/project.json

10
src/ImageProcessorCore/Formats/Png/PngDecoderCore.cs

@ -371,30 +371,30 @@ namespace ImageProcessorCore.Formats
/// <summary>
/// Validates the png header.
/// </summary>
/// <exception cref="ImageFormatException">
/// <exception cref="NotSupportedException">
/// Thrown if the image does pass validation.
/// </exception>
private void ValidateHeader()
{
if (!ColorTypes.ContainsKey(this.header.ColorType))
{
throw new ImageFormatException("Color type is not supported or not valid.");
throw new NotSupportedException("Color type is not supported or not valid.");
}
if (!ColorTypes[this.header.ColorType].SupportedBitDepths.Contains(this.header.BitDepth))
{
throw new ImageFormatException("Bit depth is not supported or not valid.");
throw new NotSupportedException("Bit depth is not supported or not valid.");
}
if (this.header.FilterMethod != 0)
{
throw new ImageFormatException("The png specification only defines 0 as filter method.");
throw new NotSupportedException("The png specification only defines 0 as filter method.");
}
if (this.header.InterlaceMethod != 0)
{
// TODO: Support interlacing
throw new ImageFormatException("Interlacing is not supported.");
throw new NotSupportedException("Interlacing is not supported.");
}
}

9
src/ImageProcessorCore/project.json

@ -6,8 +6,17 @@
"James Jackson-South and contributors"
],
"packOptions": {
"owners": [
"James Jackson-South and contributors"
],
"projectUrl": "https://github.com/JimBobSquarePants/ImageProcessor",
"licenseUrl": "http://www.apache.org/licenses/LICENSE-2.0",
"iconUrl": "https://raw.githubusercontent.com/JimBobSquarePants/ImageProcessor/Core/build/icons/imageprocessor-logo-128.png",
"requireLicenseAcceptance": false,
"repository": {
"type": "git",
"url": "https://github.com/JimBobSquarePants/ImageProcessor"
},
"tags": [
"Image Resize Crop Quality Gif Jpg Jpeg Bitmap Png Fluent Animated"
]

Loading…
Cancel
Save