Skip to content

Commit cf91269

Browse files
committed
Remove "msc" comments.
1 parent 6e9ee6b commit cf91269

File tree

2 files changed

+7
-28
lines changed

2 files changed

+7
-28
lines changed

lodepng.cpp

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,6 @@ freely, subject to the following restrictions:
2727
The manual and changelog are in the header file "lodepng.h"
2828
Rename this file to lodepng.cpp to use it for C++, or to lodepng.c to use it for C.
2929
*/
30-
/*
31-
This file has been altered from the original. The decodeGeneric function has
32-
been split into the public lodepng_decode_chunks and static inflateIdat.
33-
decodeGeneric has been reimplemented by calling these 2 functions. A new
34-
public lodepng_finish_decode has been added. With the new public functions
35-
a user can separate decode of all the chunks, so as to learn all the details
36-
of the file, from decompression, and possible conversion, of the image data.
37-
Search for msc to see the changes.
38-
39-
Additional warning disables have been added. 4267 for MS VC++ and the
40-
equivalent -Wshorten-64-to-32 for clang. "32-bit shift implicitly converted
41-
to 64 bits" warnings have been fixed by changing 1u constants to 1ull.
42-
*/
4330

4431
#include "lodepng.h"
4532

@@ -5298,8 +5285,8 @@ unsigned lodepng_inspect_chunk(LodePNGState* state, size_t pos,
52985285
return error;
52995286
}
53005287

5301-
/*extracted from the original decodeGeneric by msc*/
53025288
/*read the PNG's chunks, updating the state and accumulating the iDAT chunks*/
5289+
/*extracted from previous version of decodeGeneric*/
53035290
unsigned lodepng_decode_chunks(void** idat_out, size_t* idatsize_out, unsigned* w, unsigned* h,
53045291
LodePNGState* state,
53055292
const unsigned char* in, size_t insize) {
@@ -5480,7 +5467,7 @@ unsigned lodepng_decode_chunks(void** idat_out, size_t* idatsize_out, unsigned*
54805467
return state->error;
54815468
}
54825469

5483-
/*extracted from the original decodeGeneric by msc*/
5470+
/*extracted from the previous version of decodeGeneric*/
54845471
static unsigned inflateIdat(unsigned char** out,
54855472
unsigned char* directOut, size_t directOutSize,
54865473
unsigned w, unsigned h,
@@ -5507,7 +5494,7 @@ static unsigned inflateIdat(unsigned char** out,
55075494
If the decompressed size does not match the prediction, the image must be corrupt.*/
55085495
if(state->info_png.interlace_method == 0) {
55095496
unsigned bpp = lodepng_get_bpp(&state->info_png.color);
5510-
expected_size = lodepng_get_raw_size_idat(*w, *h, bpp);
5497+
expected_size = lodepng_get_raw_size_idat(w, h, bpp);
55115498
} else {
55125499
unsigned bpp = lodepng_get_bpp(&state->info_png.color);
55135500
/*Adam-7 interlaced: expected size is the sum of the 7 sub-images sizes*/
@@ -5545,7 +5532,6 @@ static unsigned inflateIdat(unsigned char** out,
55455532
return state->error;
55465533
}
55475534

5548-
/*added by msc*/
55495535
/*finishes decode by inflating the images captured from the idat chunks by lodepng_decode_chunks
55505536
and converting them if info_raw differs from info_png.color. A buffer to receive the final
55515537
image data is provided as a parameter.
@@ -5585,8 +5571,8 @@ unsigned lodepng_finish_decode(unsigned char* cbuffer, size_t cbufsize,
55855571
return state->error;
55865572
}
55875573

5588-
/*reimplemented by msc.*/
55895574
/*read a PNG, the result will be in the same color type as the PNG (hence "generic")*/
5575+
/*reimplemented by calling the functions extracted from previous version*/
55905576
static void decodeGeneric(unsigned char** out, unsigned* w, unsigned* h,
55915577
LodePNGState* state,
55925578
const unsigned char* in, size_t insize) {
@@ -7110,7 +7096,6 @@ const char* lodepng_error_text(unsigned code) {
71107096
case 120: return "invalid cLLI chunk size";
71117097
case 121: return "invalid chunk type name: may only contain [a-zA-Z]";
71127098
case 122: return "invalid chunk type name: third character must be uppercase";
7113-
// Added for 'msc' changes
71147099
case 123: return "destination buffer too small";
71157100
}
71167101
return "unknown error code";

lodepng.h

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,6 @@ freely, subject to the following restrictions:
2323
distribution.
2424
*/
2525

26-
/*
27-
This file has been altered from the original. Public lodepng_decode_chunks
28-
and lodepng_finish_decode functions have been added. With these new functions
29-
a user can separate decode of all the chunks, so as to learn all the details
30-
of the file, from decompression, and possible conversion, of the image data.
31-
Search for msc to see the changes.
32-
*/
3326
#ifndef LODEPNG_H
3427
#define LODEPNG_H
3528

@@ -974,7 +967,6 @@ void lodepng_state_copy(LodePNGState* dest, const LodePNGState* source);
974967
/*
975968
Read the PNG's chunks, updating the state and accumulating the iDAT chunks.
976969
idat_out will be set to point to the accumulated iDAT chunks.
977-
Added by msc.
978970
*/
979971
unsigned lodepng_decode_chunks(void** idat_out, size_t* idatsize_out, unsigned* w, unsigned* h,
980972
LodePNGState* state,
@@ -984,7 +976,6 @@ unsigned lodepng_decode_chunks(void** idat_out, size_t* idatsize_out, unsigned*
984976
Inflate the idat accumulated by lodepng_decode_chunks, convert to match
985977
the state->info_raw color type, if necessary, and return the data in
986978
the memory pointed to by cbuffer.
987-
Added by msc.
988979
*/
989980
unsigned lodepng_finish_decode(unsigned char* cbuffer, size_t cbufsize,
990981
unsigned w, unsigned h,
@@ -2028,6 +2019,9 @@ symbol.
20282019
Not all changes are listed here, the commit history in github lists more:
20292020
https://github.com/lvandeve/lodepng
20302021
2022+
*) 19 may 2025: Separated chunk decoding from image decoding and expansion.
2023+
A user can now first decode all the chunks to learn details of the image
2024+
then decompress and, possibly, convert the image data.
20312025
*) 6 may 2025: renamed mDCv to mDCV and cLLi to cLLI as per the recent rename
20322026
in the draft png third edition spec. Please note that while the third
20332027
edition is not finalized, backwards-incompatible changes to its features are

0 commit comments

Comments
 (0)