Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/SatDump/SatDump
Browse files Browse the repository at this point in the history
  • Loading branch information
Aang23 committed May 12, 2024
2 parents 72eccf0 + b11517e commit b2d3792
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion satdump_cfg.json
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
"pbm",
"qoi"
],
"description": "Image format for raw image products\n\npng: PNG Image (recommended)\n\nj2k: JPEG 2000\n\njpg: JPEG Image (not recommended; may result\nin low-quality composites and projections)\n\npbm : Really fast, but will result is very big files"
"description": "Image format for raw image products\n\npng: PNG Image (recommended)\n\nj2k: JPEG 2000\n\njpg: JPEG Image (not recommended; may result\nin low-quality composites and projections)\n\npbm : Really fast, but will result is very big files\n\nqoi: A very fast image format with compression"
},
"image_format": {
"type": "options",
Expand Down
2 changes: 1 addition & 1 deletion src-core/common/image/io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ namespace image
return false;
}

if (image_format != "png" && image_format != "jpg" && image_format != "j2k" && image_format != "pbm" && image_format != "tif")
if (image_format != "png" && image_format != "jpg" && image_format != "j2k" && image_format != "pbm" && image_format != "tif" && image_format != "qoi")
{
logger->error("Image format not specified, and default format is invalid!");
return false;
Expand Down
8 changes: 4 additions & 4 deletions src-core/common/image/io/qoiio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ namespace image
desc.width = d_width;
desc.height = d_height;
desc.channels = final_channels;
desc.colorspace = QOI_SRGB;
desc.colorspace = QOI_LINEAR;
qoi_write(file.c_str(), qoi_buffer, &desc);

// Custom marker for single-channel files
Expand Down Expand Up @@ -74,12 +74,12 @@ namespace image
{
fclose(fin);
is_single_channel = lastByte == 0xAA;
logger->info("TRAILER");
// logger->info("TRAILER");
}
}
}

logger->critical("isSingle %d", (int)is_single_channel);
// logger->critical("isSingle %d", (int)is_single_channel);

qoi_desc desc;
uint8_t *qoi_buffer = (uint8_t *)qoi_read(file.c_str(), &desc, 4);
Expand All @@ -96,7 +96,7 @@ namespace image
for (size_t i = 0; i < d_width * d_height; i++)
img.set(i, qoi_buffer[i * 4 + 0]);
}
else if (d_channels == 3)
else if (d_channels >= 3)
{
for (size_t i = 0; i < d_width * d_height; i++)
for (int c = 0; c < d_channels; c++)
Expand Down

0 comments on commit b2d3792

Please sign in to comment.