bitbank2 / JPEGDEC

An optimized JPEG decoder for Arduino
Apache License 2.0
365 stars 47 forks source link

Problem adding JPEGDEC on an existing libraries #33

Closed maxmeli123 closed 2 years ago

maxmeli123 commented 2 years ago

Please Larry do not close OPEN and NOT RESOLVED issues.

Like how you answered to my questions my problem seem solved, but noooooo it is not solved.

I spent dozens and dozens of working hours to understand how to integrate JPEGDEC inside an existing C++ library, made dozens of different attempts, tried to use the C ++ functions and even C functions (as by your advice), but none of these solutions worked.

From September 2021 I am still wait in my development for this reason and can no longer work on it because I only obtain compilation errors.

But if for you it is so simple (like you said) because you don't spend a single time to help me to solve this big problem? Is it a matter of money? Do you want to be paid? This is for a job that doesn't make anything, not even 1 dollar, because my OLED and TFT libraries will be completely opensouce on GITHUB as your library.

What should I do to be heard and helped to solve this problem once and for all?

Another time Many Thanks

bitbank2 commented 2 years ago

Max, This is my repo and I can do as I please with it. I don't owe you any tech support time to make use of code that I provide freely. If you find it useful, great; if not, you are free to not use it. I did spend time on your issue, but your environment is non-standard and you are trying to mix and match different bits of code from different environments.

This code works fine in the Arduino environment, PlatformIO, ESP-IDF, MicroPython and Linux (as both C++ and C code). The last issue you opened indicated that you don't really understand C vs C++ mangled name linkage. It's not my place to use Github issues to teach you about programming topics. You haven't provided information of a valid bug for me to fix.

It's not about money or about being heard. I treat all issues with seriousness because I want my code to work correctly. What you're trying to do can probably work, but it would help if you understood better how C and C++ code interoperate.

My advice in cases like this is to start simple and work your way up to more complex. The linux example code is probably the easiest way to do what you want. All you have to do is include JPEGDEC.h followed by jpeg.inl into your C code and it will just work.

I'm closing this issue because it doesn't represent a problem with JPEGDEC, only a problem with your attempt to use it.

maxmeli123 commented 2 years ago

Okay, you have closed the conversation, great! but I would just like to make some clarifications.

I am very sorry that you took it this way, mine was not a demand, but rather a request for help.

I didn't ask you to give me programming lessons, just to help me link your library into my library so that it works and I can implement inside my other ports.

I don't seem to have accused you of something or am I wrong?

My library is not the problem it is already working. It is not true that I have mixed various environments, maybe I have not explained myself well because English is not my original language and I use a translator.

I am working in Arduino environment with Arduino IDE, no other environment. I wrote a library for oled (and then ported for tft) as if it was for example an Adafruit library, it shows BMP images, even JPEG ones, but for JPEG because your decoder has superior performance I simply removed the current one and I have to replace it with your JPEGDEC.

I even posted you a single sketch containing the main sketch and inline my library .cpp and .h file, one single enviroment, all the code inside a single Arduino sketch.

That's all, tell me what environments I mixed. I'm only using Arduino IDE and C ++, then tried to implement your C++ code, then I had to use your library with C functions, you told me to do this. I have not mixed any language, this is not true.

bitbank2 commented 2 years ago

Your original issue was about not understanding how to access your TFT class from within the JPEGDRAW callback, correct? This is not a problem with my library. A Github issue opened on a non-bug is not what (I believe) issues are about. I offered some suggestions.

The callback method doesn't have to be static - you pass it dynamically through a method. You can access your TFT class through a dynamic "this" pointer by keeping it in a global variable. You only have one instance of that class in use, correct? So there's no danger in keeping it in a global variable that can be seen by all methods. This may not be the best C++ design, but it will work.

The language of your post is not an issue either - you're free to post in Italian, English or whatever you like. I'll answer issues written in any language and if I don't know how to speak it I'll use Google translate.

Conclusion - you're still not opening issues on problems with my library. You have not provided any evidence that there is a problem with my library. You need to better understand how C++ classes work to get your code working. Please carefully read the beginning of this reply and you will find a solution to your problem.