Closed viveky1794 closed 3 years ago
did you find any solution ? I have the same trouble (panda sample displaying ... my image isn't. no progressive jpg, nothing special)
I tried the second image above and can confirm that it will not be decoded. I then opened it in MS Paint, saved it again and it worked fine. Here is that image:
So there must be something incompatible in the format, maybe it contains a "thumb nail image?
I tried the JPEGDecoder library which uses a different decode engine and it reports "Jpeg file format not supported!", so this means it is encoded in an unsupported format.
The JPEGDecoder library did load the image version posted above.
I ran analysis on the original image and it is in progressive format which is not supported:
I am doing a project where I need to store my jpeg file into SPIFFS for later use. I am using Arduino IDE. So I am putting 2 JPEG images into "data" folder. Then Updating after going "Tool>ESP32 sketch upload" section.
@Problem : One Image name " AA.jpg " Is rendering. But Second image namely "ABC.jpg" is not rendering. Can anyone suggest the possible reason and solution.
@Code :
// This function will clip the image block rendering automatically at the TFT boundaries tft.pushImage(x, y, w, h, bitmap);
// Return 1 to decode next block return 1; }
tft.init(); tft.fillScreen(TFT_BLACK); tft.setRotation(1); uint16_t calData[5] = { 329, 3444, 448, 3193, 2 }; tft.setTouch(calData); tft.fillScreen(TFT_BLACK);
// Initialise SPIFFS if (!SPIFFS.begin()) { Serial.println("SPIFFS initialisation failed!"); while (1) yield(); // Stay here twiddling thumbs waiting } //SPIFFS.flush(); Serial.println("\r\nInitialisation done."); tft.setSwapBytes(true); // We need to swap the colour bytes (endianess)
// The jpeg image can be scaled by a factor of 1, 2, 4, or 8 TJpgDec.setJpgScale(1);
// The decoder must be given the exact name of the rendering function above TJpgDec.setCallback(tft_output);
// Draw the image, top left at 0,0 TJpgDec.drawFsJpg(0, 0, "/ABC.jpg"); // Not Wroking delay(2000); }
void loop() { TJpgDec.drawFsJpg(0, 0, "/AA.jpg"); // Working }
@Images : 1 : AA
2 : ABC