aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar jonas <himself@jonasgunz.de> 2019-04-20 11:02:36 +0200
committerGravatar jonas <himself@jonasgunz.de> 2019-04-20 11:02:36 +0200
commita8934902644a6353b5914e0d6bad37f95bd8e730 (patch)
treea76090fa754ae71b7bc42b9e3894825ad776630a
parent04a69bbd8ab364f561dd489d88f106fc1e912400 (diff)
downloadheadstripper-a8934902644a6353b5914e0d6bad37f95bd8e730.tar.gz
Cleanup
-rw-r--r--.gitignore1
-rw-r--r--src/main.c6
2 files changed, 4 insertions, 3 deletions
diff --git a/.gitignore b/.gitignore
index b43acdc..ae1c71b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,3 +4,4 @@ build/
*.png
*.swp
*.strip
+tags
diff --git a/src/main.c b/src/main.c
index 02e1c42..3307ffd 100644
--- a/src/main.c
+++ b/src/main.c
@@ -28,10 +28,12 @@
#define _JPG_EOI 0xD9 //End of image
//PNG
+//Essential chunks
#define _PNG_IHDR 0x52444849
#define _PNG_IDAT 0x54414449
#define _PNG_IEND 0x444E4549
#define _PNG_PLTE 0x45544C50
+//Aux chunks
#define _PNG_tRNS 0x534e5274
#define _PNG_gAMA 0x414d4167
#define _PNG_cHRM 0x4d524863
@@ -191,7 +193,6 @@ int strip_png(char *_filename)
while(1)
{
//Heavy shifting
- //Chunk header is 4B
chunk_len = ((chunk_len << 8) & 0xFFFFFF00) + ( read_buff & 0x000000FF );
unsigned char c = fgetc(in);
@@ -216,7 +217,7 @@ int strip_png(char *_filename)
//*Ghetto music plays*
uint64_t chunk_str = 0;
chunk_str += read_buff;
- printf("CHUNK %s SIZE %uB\n", &chunk_str, chunk_len);
+ printf("CHUNK %s SIZE %uB\n", (char*)(&chunk_str), chunk_len);
fread(f__buffer, 1, chunk_len, in);
fread(&crc, 1, 4, in);
@@ -228,7 +229,6 @@ int strip_png(char *_filename)
fputc(lencpy >> 24, out);
lencpy <<= 8;
}
- //fwrite(&chunk_len, 1, sizeof(chunk_len), out); //IS flipped!
fwrite(&read_buff, 1, sizeof(read_buff), out);
fwrite(f__buffer, 1, chunk_len, out);