Fix truecolor support detection
This commit is contained in:
parent
d4b0ae591d
commit
f785ecf9c1
@ -9,9 +9,12 @@ static inline int t2p(int val) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void write(std::ostream& os, FILE* in) {
|
static void write(std::ostream& os, FILE* in) {
|
||||||
char* tc = getenv("TRUECOLOR");
|
char* tc = getenv("COLORTERM");
|
||||||
std::string truecolor {tc ? tc : ""};
|
std::string colorterm {tc ? tc : ""};
|
||||||
bool has_truecolor = truecolor.size() > 0;
|
bool has_truecolor = colorterm.size() > 0;
|
||||||
|
if (has_truecolor) {
|
||||||
|
has_truecolor = colorterm == "truecolor" || colorterm == "24bit";
|
||||||
|
}
|
||||||
struct pam info;
|
struct pam info;
|
||||||
pnm_readpaminit(in, &info, PAM_STRUCT_SIZE(tuple_type));
|
pnm_readpaminit(in, &info, PAM_STRUCT_SIZE(tuple_type));
|
||||||
std::unique_ptr<tuple, void(*)(void*)> row1 {pnm_allocpamrow(&info), pm_freerow};
|
std::unique_ptr<tuple, void(*)(void*)> row1 {pnm_allocpamrow(&info), pm_freerow};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user