File tree Expand file tree Collapse file tree 2 files changed +22
-8
lines changed
Expand file tree Collapse file tree 2 files changed +22
-8
lines changed Original file line number Diff line number Diff line change @@ -54,8 +54,11 @@ namespace appimage {
5454 std::move (data.begin (), data.end (), originalData.begin ());
5555
5656 // guess the image format by trying to load it
57- if (!tryLoadPng (originalData) && !tryLoadSvg (originalData)) {
58- throw IconHandleError (" Unable to load image." );
57+ if (!tryLoadPng (originalData)) {
58+ throw IconHandleError (" Unable to load PNG image" );
59+ }
60+ if (!tryLoadSvg (originalData)) {
61+ throw IconHandleError (" Unable to load SVG image" );
5962 }
6063
6164 iconSize = iconOriginalSize = getOriginalSize ();
@@ -65,8 +68,12 @@ namespace appimage {
6568 readFile (path);
6669
6770 // guess the image format by trying to load it
68- if (!tryLoadPng (originalData) && !tryLoadSvg (originalData))
69- throw IconHandleError (" Unable to load image." );
71+ if (!tryLoadPng (originalData)) {
72+ throw IconHandleError (" Unable to load PNG image" );
73+ }
74+ if (!tryLoadSvg (originalData)) {
75+ throw IconHandleError (" Unable to load SVG image" );
76+ }
7077
7178 iconSize = iconOriginalSize = getOriginalSize ();
7279 }
Original file line number Diff line number Diff line change @@ -8,8 +8,11 @@ namespace appimage {
88 std::move (data.begin (), data.end (), originalData.begin ());
99
1010 // guess the image format by trying to load it
11- if (!tryLoadPng (originalData) && !tryLoadSvg (originalData)) {
12- throw IconHandleError (" Unable to load image." );
11+ if (!tryLoadPng (originalData)) {
12+ throw IconHandleError (" Unable to load PNG image" );
13+ }
14+ if (!tryLoadSvg (originalData)) {
15+ throw IconHandleError (" Unable to load SVG image" );
1316 }
1417
1518 iconSize = iconOriginalSize = getOriginalSize ();
@@ -19,8 +22,12 @@ namespace appimage {
1922 readFile (path);
2023
2124 // guess the image format by trying to load it
22- if (!tryLoadPng (originalData) && !tryLoadSvg (originalData))
23- throw IconHandleError (" Unable to load image." );
25+ if (!tryLoadPng (originalData)) {
26+ throw IconHandleError (" Unable to load PNG image" );
27+ }
28+ if (!tryLoadSvg (originalData)) {
29+ throw IconHandleError (" Unable to load SVG image" );
30+ }
2431
2532 iconSize = iconOriginalSize = getOriginalSize ();
2633 }
You can’t perform that action at this time.
0 commit comments