From 047b1f4f112a838ee06aec330fd3af95c0e04543 Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Wed, 20 Jan 2016 17:33:59 +1100 Subject: [PATCH] Reduce magic number count by one. Former-commit-id: cbd1a16d7ba048e92ee4fbe5e739764d639c0ab3 Former-commit-id: 2b2af7344ebb2bc922ced7934bea6afd304ffb70 Former-commit-id: f635c6194e2d40387bf962a4e0973128bf06575a --- src/ImageProcessor/Formats/Png/PngDecoderCore.cs | 1 + .../TestImages/Formats/Png/mountain.png.REMOVED.git-id | 1 + 2 files changed, 2 insertions(+) create mode 100644 tests/ImageProcessor.Tests/TestImages/Formats/Png/mountain.png.REMOVED.git-id diff --git a/src/ImageProcessor/Formats/Png/PngDecoderCore.cs b/src/ImageProcessor/Formats/Png/PngDecoderCore.cs index 2ae91f258..85ed12c12 100644 --- a/src/ImageProcessor/Formats/Png/PngDecoderCore.cs +++ b/src/ImageProcessor/Formats/Png/PngDecoderCore.cs @@ -201,6 +201,7 @@ namespace ImageProcessor.Formats Array.Reverse(data, 0, 4); Array.Reverse(data, 4, 4); + // 39.3700787 = inches in a meter. this.currentImage.HorizontalResolution = BitConverter.ToInt32(data, 0) / 39.3700787d; this.currentImage.VerticalResolution = BitConverter.ToInt32(data, 4) / 39.3700787d; } diff --git a/tests/ImageProcessor.Tests/TestImages/Formats/Png/mountain.png.REMOVED.git-id b/tests/ImageProcessor.Tests/TestImages/Formats/Png/mountain.png.REMOVED.git-id new file mode 100644 index 000000000..e10578b3c --- /dev/null +++ b/tests/ImageProcessor.Tests/TestImages/Formats/Png/mountain.png.REMOVED.git-id @@ -0,0 +1 @@ +e51bffc5ceb300a70039c9c3ce4542eff47925ea \ No newline at end of file