So I did some experiment and I was on the right way to do it, except I'm trying to port an example that uses BMP files and those won't be displayed.
I downloaded the flower from M5Paper examples.
I put it on my SD card, both as /flower.jpg and /bmp/flower2.jpg (I know, bmp is for... bmp files, but I wanted to test file in a folder)
Then I run the code from @world101 just renaming the file I wanted.
This works.
I then put my bmp files (coming from an Adafruit guide) in my SD card, folder is bmp.
I even tried to use a shorter name for the file.
None worked.
M5EPD_Canvas canvas(&M5.EPD);
void setup()
{
M5.begin();
M5.EPD.SetRotation(90);
M5.EPD.Clear(true);
//overlay bg on full screen
canvas.createCanvas(540, 960);
//canvas.setTextSize(2);
//jpg must be in 90degree (full screen)
//image from SD card
//canvas.drawJpgFile(SD, "/bmp/flower2.jpg"); //put image.jpg on the sdcard before uploading sketch
//canvas.drawBmpFile(SD, "/bmp/weather_icons_20px.bmp", 0, 0);
canvas.drawBmpFile(SD, "/bmp/shortname.bmp", 0, 0);
canvas.pushCanvas(0, 0, UPDATE_MODE_GC16);
delay(2000);
//shutdown to save battery
Serial.println("shutting down now...");
M5.shutdown();
}
void loop()
{
}
I think I need to dig the documentation to find which precise BMP format is supported.