<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Anybody get drawJpgFile to work with M5 PaperS3?]]></title><description><![CDATA[<p dir="auto">Anybody get drawJpgFile and SPIFFS to work with M5 PaperS3? The following program finds the file "badge.jpg" but the jpeg is not displayed. I have turned jpg optimization and progressive off since that has been a source of problems in the past:</p>
<pre><code>#include &lt;epdiy.h&gt;
#include &lt;SPIFFS.h&gt;
#include &lt;M5GFX.h&gt;

M5GFX display;

void setup(void)
{ 
  display.init();
  display.startWrite();
  display.fillScreen(TFT_WHITE);
  display.setTextSize(5.0);
  if (display.isEPD())
  { 
    display.setEpdMode(epd_mode_t::epd_fastest);
  }
  // eyelet at top
  display.setRotation(display.getRotation() ^ 2);
  
  display.println("I RUN");
  if(!SPIFFS.begin(true)){
    display.println("An Error has occurred while mounting SPIFFS");
  }
  display.println("SPIFFS OK");
  File file = SPIFFS.open("/badge.jpg");
  if(!file){
    display.println("Failed to open file");
  }
  file.close();
  display.println("Open OK");
  
  display.drawJpgFile(SPIFFS, "/badge.jpg" , 0, 0);
  display.display();
}
</code></pre>
<p dir="auto">If I cant get drawJpgFile to work, has someone written a script to put the result in a const array such as in the example file at <a href="https://github.com/m5stack/M5GFX/blob/2c12f148d6e3df64ead33b04c7989fe6d90a7a83/examples/Basic/drawImageData/drawImageData.ino" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/m5stack/M5GFX/blob/2c12f148d6e3df64ead33b04c7989fe6d90a7a83/examples/Basic/drawImageData/drawImageData.ino</a>?</p>
]]></description><link>https://community.m5stack.com/topic/7120/anybody-get-drawjpgfile-to-work-with-m5-papers3</link><generator>RSS for Node</generator><lastBuildDate>Wed, 29 Apr 2026 06:49:32 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/7120.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 27 Dec 2024 04:00:36 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Anybody get drawJpgFile to work with M5 PaperS3? on Wed, 21 May 2025 16:55:01 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/wsanders" aria-label="Profile: wsanders">@<bdi>wsanders</bdi></a> Bump. For future reference, the easiest way to get a static image into Arduino IDE code is to convert the image into an XBM with Gimp and use M5.Display.drawXBitmap. More here: <a href="https://github.com/wsanders/M5PaperS3-Stuff" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/wsanders/M5PaperS3-Stuff</a></p>
]]></description><link>https://community.m5stack.com/post/29081</link><guid isPermaLink="true">https://community.m5stack.com/post/29081</guid><dc:creator><![CDATA[wsanders]]></dc:creator><pubDate>Wed, 21 May 2025 16:55:01 GMT</pubDate></item><item><title><![CDATA[Reply to Anybody get drawJpgFile to work with M5 PaperS3? on Fri, 27 Dec 2024 17:57:21 GMT]]></title><description><![CDATA[<p dir="auto">Now that I think of it, I could not get drawJpgFile to work in a previous project (a fake Nixie watch), and I see from the PaperS3 demo program sample code that the Jpg is stored as a static array.</p>
<p dir="auto">I got my simple badge display program to work by storing the image as a C array (exported from GIMP) and walking through the pixels, which is how I did it in my previous project. Suprisingly it's not incredibly slow but of course data in this format is incredibly bulky.</p>
<p dir="auto">This github code is an example of how to convert a file into a statoc C array: <a href="https://github.com/notisrac/FileToCArray" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/notisrac/FileToCArray</a></p>
<p dir="auto">In the next few days, maybe I'll figure out if SPIFFS works on the PaperS3 and report back.</p>
]]></description><link>https://community.m5stack.com/post/27604</link><guid isPermaLink="true">https://community.m5stack.com/post/27604</guid><dc:creator><![CDATA[wsanders]]></dc:creator><pubDate>Fri, 27 Dec 2024 17:57:21 GMT</pubDate></item><item><title><![CDATA[Reply to Anybody get drawJpgFile to work with M5 PaperS3? on Fri, 27 Dec 2024 05:30:21 GMT]]></title><description><![CDATA[<p dir="auto">This is probably a problem with SPIFFs. If I change the file open to</p>
<pre><code>  File file = SPIFFS.open("/NONEXISTENT");
</code></pre>
<p dir="auto">the open still succeeds even though the file doesn't <a href="http://exist.So" target="_blank" rel="noopener noreferrer nofollow ugc">exist.So</a> I have no way to know if drawJpgFile even works or not.</p>
]]></description><link>https://community.m5stack.com/post/27596</link><guid isPermaLink="true">https://community.m5stack.com/post/27596</guid><dc:creator><![CDATA[wsanders]]></dc:creator><pubDate>Fri, 27 Dec 2024 05:30:21 GMT</pubDate></item></channel></rss>