mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-14 12:04:29 +00:00
svg2png: Add more error message types
Add a message according to the returned Result type.
This commit is contained in:
parent
0d010bdb6a
commit
8ef075eb27
1 changed files with 8 additions and 1 deletions
|
@ -69,9 +69,16 @@ public:
|
|||
|
||||
//Picture
|
||||
auto picture = tvg::Picture::gen();
|
||||
if (picture->load(path) != tvg::Result::Success) {
|
||||
tvg::Result result = picture->load(path);
|
||||
if (result == tvg::Result::Unknown) {
|
||||
cout << "Error: Couldn't load image " << path << endl;
|
||||
return 1;
|
||||
} else if (result == tvg::Result::InvalidArguments) {
|
||||
cout << "Error: Couldn't load image(Invalid path or invalid SVG image) : " << path << endl;
|
||||
return 1;
|
||||
} else if (result == tvg::Result::NonSupport) {
|
||||
cout << "Error: Couldn't load image(Not supported extension) : " << path << endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (w == 0 || h == 0) {
|
||||
|
|
Loading…
Add table
Reference in a new issue