Click here to Skip to main content
15,912,977 members
Home / Discussions / C#
   

C#

 
QuestionDeleting the Palette Chunk from png stream Pin
Shailesh H9-Feb-12 7:59
Shailesh H9-Feb-12 7:59 
GeneralRe: Deleting the Palette Chunk from png stream Pin
harold aptroot9-Feb-12 8:35
harold aptroot9-Feb-12 8:35 
GeneralRe: Deleting the Palette Chunk from png stream Pin
Shailesh H9-Feb-12 20:59
Shailesh H9-Feb-12 20:59 
GeneralRe: Deleting the Palette Chunk from png stream Pin
harold aptroot9-Feb-12 23:45
harold aptroot9-Feb-12 23:45 
Ok that's odd, but ok. This is what I would do.
Read the file back with a BinaryReader. Beware that integers in PNG are stored big-endian, so if you need their integer value you have to byte-reverse it (there is of course no good reason to reverse the FourCC's, just reverse the constants you test them against).
Write all chunks to an other stream unless the FourCC of the chunk is PLTE (FourCC's can not be read as strings because they are not strings in the way BinaryReader wants them, just read an int32 and test against 0x45544C50 (ETLP in ASCII) - the other FourCC's are not relevant, just write anything "unknown" to the destination stream).
AnswerRe: Deleting the Palette Chunk from png stream Pin
BobJanova9-Feb-12 22:07
BobJanova9-Feb-12 22:07 
GeneralRe: Deleting the Palette Chunk from png stream Pin
Shailesh H9-Feb-12 22:58
Shailesh H9-Feb-12 22:58 
GeneralRe: Deleting the Palette Chunk from png stream Pin
BobJanova10-Feb-12 4:23
BobJanova10-Feb-12 4:23 
QuestionWhich approach is better for this problem? Pin
AmbiguousName9-Feb-12 4:23
AmbiguousName9-Feb-12 4:23 
AnswerRe: Which approach is better for this problem? Pin
SledgeHammer019-Feb-12 4:40
SledgeHammer019-Feb-12 4:40 
GeneralRe: Which approach is better for this problem? Pin
Pete O'Hanlon9-Feb-12 5:30
mvePete O'Hanlon9-Feb-12 5:30 
GeneralRe: Which approach is better for this problem? Pin
SledgeHammer019-Feb-12 15:22
SledgeHammer019-Feb-12 15:22 
GeneralRe: Which approach is better for this problem? Pin
Pete O'Hanlon9-Feb-12 22:06
mvePete O'Hanlon9-Feb-12 22:06 
GeneralRe: Which approach is better for this problem? Pin
SledgeHammer0110-Feb-12 3:52
SledgeHammer0110-Feb-12 3:52 
GeneralRe: Which approach is better for this problem? Pin
jschell9-Feb-12 13:34
jschell9-Feb-12 13:34 
GeneralRe: Which approach is better for this problem? Pin
SledgeHammer019-Feb-12 15:17
SledgeHammer019-Feb-12 15:17 
GeneralRe: Which approach is better for this problem? Pin
Pete O'Hanlon9-Feb-12 21:59
mvePete O'Hanlon9-Feb-12 21:59 
GeneralRe: Which approach is better for this problem? Pin
SledgeHammer0110-Feb-12 3:48
SledgeHammer0110-Feb-12 3:48 
GeneralRe: Which approach is better for this problem? Pin
Pete O'Hanlon10-Feb-12 3:56
mvePete O'Hanlon10-Feb-12 3:56 
GeneralRe: Which approach is better for this problem? Pin
jschell10-Feb-12 9:20
jschell10-Feb-12 9:20 
GeneralRe: Which approach is better for this problem? Pin
SledgeHammer0110-Feb-12 9:34
SledgeHammer0110-Feb-12 9:34 
GeneralRe: Which approach is better for this problem? Pin
jschell12-Feb-12 7:29
jschell12-Feb-12 7:29 
GeneralRe: Which approach is better for this problem? Pin
SledgeHammer0112-Feb-12 8:43
SledgeHammer0112-Feb-12 8:43 
GeneralRe: Which approach is better for this problem? Pin
jschell14-Feb-12 13:27
jschell14-Feb-12 13:27 
GeneralRe: Which approach is better for this problem? Pin
SledgeHammer0114-Feb-12 13:58
SledgeHammer0114-Feb-12 13:58 
GeneralRe: Which approach is better for this problem? Pin
jschell15-Feb-12 8:36
jschell15-Feb-12 8:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.