From 8a018fdb82ba121e9b5be09998cca94a992ba722 Mon Sep 17 00:00:00 2001 From: Thomas Bernard Date: Thu, 28 Jun 2018 14:30:39 +0200 Subject: [PATCH] fix Save_PI1() the color cycling information was always overwriting the last 32 bytes so the last 16 pixels were almost always saved black --- src/miscfileformats.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/miscfileformats.c b/src/miscfileformats.c index 28a18f7b..25408419 100644 --- a/src/miscfileformats.c +++ b/src/miscfileformats.c @@ -1697,10 +1697,14 @@ void Save_PI1(T_IO_Context * context) ptr+=8; } } - PI1_save_ranges(context, buffer, 32034); if (Write_bytes(file,buffer,32034)) { + if (context->Color_cycles) + { + PI1_save_ranges(context, buffer, 32); + Write_bytes(file,buffer,32); + } fclose(file); } else // Error d'écriture (disque plein ou protégé)