mirror of
https://github.com/yuzu-emu/FasTC.git
synced 2025-01-08 06:35:33 +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,7 +83,11 @@ int main(int argc, char **argv) {
|
|||
settings.iNumCompressions = numCompressions;
|
||||
|
||||
CompressedImage *ci = CompressImage(file, settings);
|
||||
|
||||
if(NULL == ci) {
|
||||
fprintf(stderr, "Error compressing image!\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
double PSNR = ComputePSNR(*ci, file);
|
||||
if(PSNR > 0.0) {
|
||||
fprintf(stdout, "PSNR: %.3f\n", PSNR);
|
||||
|
@ -93,8 +97,7 @@ int main(int argc, char **argv) {
|
|||
}
|
||||
|
||||
// Cleanup
|
||||
if(NULL != ci)
|
||||
delete ci;
|
||||
delete ci;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue