Skip to content

Commit 379bf62

Browse files
committed
Add check to see if SD card is initialized successfully
1 parent 3610df4 commit 379bf62

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/graphics/Image/Image.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,15 @@ bool Image::draw(const char *path, int x, int y, bool dither, bool invert)
124124
}
125125
else
126126
{
127+
if(_inkplate->getSdCardOk())
128+
{
127129
if (strstr(_fileExtension, "bmp") != NULL || strstr(_fileExtension, "dib") != NULL)
128130
return drawBitmapFromSd(path, x, y, dither, invert);
129131
if (strstr(_fileExtension, "jpg") != NULL || strstr(_fileExtension, "jpeg") != NULL)
130132
return drawJpegFromSd(path, x, y, dither, invert);
131133
if (strstr(_fileExtension, "png") != NULL)
132134
return drawPngFromSd(path, x, y, dither, invert);
135+
}
133136
}
134137
return 0;
135138
};

0 commit comments

Comments
 (0)