1 Star 0 Fork 31

沧海一声笑/imageinfo

forked from xiaozhuai/imageinfo 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
main.cpp 1.03 KB
一键复制 编辑 原始数据 按行查看 历史
xiaozhuai 提交于 2023-01-28 20:22 +08:00 . Optimize cmake scripts
#include <cstdio>
#include "imageinfo.hpp"
int main(int argc, char **argv) {
if (argc < 2) {
printf("Usage: %s [FILE]...\n", argv[0]);
return 1;
}
for (int i = 1; i < argc; ++i) {
const char *file = argv[i];
auto info = getImageInfo<IIFilePathReader>(file);
printf("File: %s\n", file);
if (info.getErrorCode() != II_ERR_OK) {
printf(" - Error : %s\n", info.getErrorMsg());
} else {
printf(" - Format : %d\n", info.getFormat());
printf(" - Ext : %s\n", info.getExt());
printf(" - Full Ext : %s\n", info.getFullExt());
printf(" - Size : {width: %lld, height: %lld}\n", info.getWidth(), info.getHeight());
printf(" - Mimetype : %s\n", info.getMimetype());
printf(" - Entries :\n");
for(const auto &entrySize : info.getEntrySizes()) {
printf(" - {width: %lld, height: %lld}\n", entrySize[0], entrySize[1]);
}
}
}
return 0;
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/myspace2019/imageinfo.git
git@gitee.com:myspace2019/imageinfo.git
myspace2019
imageinfo
imageinfo
master

搜索帮助