Bodmer / JPEGDecoder

A JPEG decoder library
Other
220 stars 64 forks source link

'class JPEGDecoder' has no member named 'decodeSdFile'; did you mean 'decodeFile' #66

Closed AdamMiltonBarker closed 2 years ago

AdamMiltonBarker commented 2 years ago

Arduino 33 BLE Sense Tensorflow for microcontrollers.

I have edited this issue as I have gone another way which should align with the person detector example and allow me to handle grayscaling etc.

I have tried decodeSdFile but get the error in the title, I have also tried decodeFile but when using jpegInfo() all values are zero. decodeFile is true, however all values are zero.

1 below is true for decoded.

String filepath = "Im006_1.jpg";
  String filename = "Im006_1";
  //String filepath = "Im035_0.jpg";
  //String filename = "Im035_0";
  File jpegFile = SD.open(filepath, FILE_READ);  

  if ( !jpegFile ) {
    Serial.print("ERROR: File \""); Serial.print(filepath); Serial.println ("\" not found!");
    return;
  }

  boolean decoded = JpegDec.decodeFile(filepath);

  Serial.println(decoded);
  jpegInfo();

1:47:58.908 -> Initialising SD card... 1:47:59.020 -> Initialisation done. 1:48:00.235 -> 1 1:48:00.576 -> JPEG image info 1:48:00.587 -> =============== 1:48:00.592 -> Width :0 1:48:00.594 -> Height :0 1:48:00.607 -> Components :0 1:48:00.616 -> MCU / row :0 1:48:00.626 -> MCU / col :0 1:48:00.626 -> Scan type :0 1:48:00.626 -> MCU width :0 1:48:00.630 -> MCU height :0 1:48:00.638 -> ===============

AdamMiltonBarker commented 2 years ago

Silly mistake :) I checked the source, I realized that the examples I had seen were commenting out LOAD_SD_LIBRARY because they are using cameras :D :D I have re-enabled it and removed the import for SD and it is working now :D