Bodmer / TJpg_Decoder

Jpeg decoder library based on Tiny JPEG Decompressor
Other
227 stars 43 forks source link

Use external file and callback to open file #26

Closed tsctrl closed 2 years ago

tsctrl commented 3 years ago

Hi @Bodmer ,

thank you for this great library.

few suggestion here:

  1. since there are tons of filesystem library out there. i suggested to move the file system support outside of the library, this help you to maintain this library and could prevent lots of other unrelated issue. similar approach how you create rendering jpg function.
  2. add configurable filesize limit check and return as JRESULT.
  3. add malloc and free internally if that was not yet implemented, this would free memory usage when the libs are imported but not in use. malloc the memory when decode jpeg in release once its done so memory could be use somewhere else.
  4. keep everything else simple as is :)

thanks in advanced

Bodmer commented 2 years ago

Yes, I understand you reasoning. It started out simple but then filinf systems proliferated ... SD, SPIFFS, LittleFS, LITTLEFS, FLASH arrays etc... and it has got more complicated over time.

Due to time constraints I don't plan to change things at the moment.

You may find this library better suits your needs: https://github.com/bitbank2/JPEGDEC