From 093ae0be41d8c91a2616ea0576e61e0c87c59be0 Mon Sep 17 00:00:00 2001 From: Xerbo Date: Tue, 16 Aug 2022 09:05:46 +0100 Subject: [PATCH] Dont crop channel images when crop telemetry is on, close #11 --- src/main.c | 4 ++-- src/pngio.c | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main.c b/src/main.c index 027daaa..51d91a4 100644 --- a/src/main.c +++ b/src/main.c @@ -226,7 +226,7 @@ static int processAudio(char *filename, options_t *opts){ ImageOut(opts, &tmpimg, APT_CHB_OFFSET, APT_CH_WIDTH, "Temperature", Temperature, (char *)apt_TempPalette); } - // Temperature + // Visible if (CONTAINS(opts->type, Visible) && img.chA <= 2) { // Create another buffer as to not modify the orignal apt_image_t tmpimg = img; @@ -237,7 +237,7 @@ static int processAudio(char *filename, options_t *opts){ // Perform visible calibration apt_calibrate_visible(opts->satnum, &tmpimg, APT_CHA_OFFSET, APT_CH_WIDTH); - ImageOut(opts, &tmpimg, APT_CHA_OFFSET, APT_CH_WIDTH, "Visible", Visible, (char *)apt_TempPalette); + ImageOut(opts, &tmpimg, APT_CHA_OFFSET, APT_CH_WIDTH, "Visible", Visible, NULL); } // Linear equalise diff --git a/src/pngio.c b/src/pngio.c index f092b7a..2e4f9bd 100644 --- a/src/pngio.c +++ b/src/pngio.c @@ -223,9 +223,11 @@ int ImageOut(options_t *opts, apt_image_t *img, int offset, int width, char *des for(unsigned long int i = 0; i < strlen(opts->effects); i++){ switch (opts->effects[i]) { case Crop_Telemetry: - width -= APT_TOTAL_TELE; - offset += APT_SYNC_WIDTH + APT_SPC_WIDTH; - crop_telemetry = 1; + if (width == 2080) { + width -= APT_TOTAL_TELE; + offset += APT_SYNC_WIDTH + APT_SPC_WIDTH; + crop_telemetry = 1; + } break; case Precipitation_Overlay: greyscale = 0;