mirror of
https://github.com/yuzu-emu/FasTC.git
synced 2025-07-03 16:28:13 +00:00
In the command line tool make sure that the compressed image is valid before trying to calculate its PSNR.
This commit is contained in:
parent
78da9499ec
commit
3cac6ae464
|
@ -83,6 +83,10 @@ int main(int argc, char **argv) {
|
||||||
settings.iNumCompressions = numCompressions;
|
settings.iNumCompressions = numCompressions;
|
||||||
|
|
||||||
CompressedImage *ci = CompressImage(file, settings);
|
CompressedImage *ci = CompressImage(file, settings);
|
||||||
|
if(NULL == ci) {
|
||||||
|
fprintf(stderr, "Error compressing image!\n");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
double PSNR = ComputePSNR(*ci, file);
|
double PSNR = ComputePSNR(*ci, file);
|
||||||
if(PSNR > 0.0) {
|
if(PSNR > 0.0) {
|
||||||
|
@ -93,8 +97,7 @@ int main(int argc, char **argv) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cleanup
|
// Cleanup
|
||||||
if(NULL != ci)
|
delete ci;
|
||||||
delete ci;
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue