Hi,

Have any of you added 'jpg' support to Nana 1.7.4?
Would you share details?

Brgds

Hi, Have any of you added 'jpg' support to Nana 1.7.4? Would you share details? Brgds

I just compiled Nana (branch develop-1.8) with Jpeg support, on Windows with VC2019. I didn't use the original libjpeg library, instead I found a newer version on GitHub: https://github.com/libjpeg-turbo/libjpeg-turbo (I built it very easily using Visual Studio's innate support for CMake). After that, I did the following:

(1) I copied the following files to nana\extrlib:

  • libjpeg-turbo-main\out\build\x64-Debug\jconfig.h
  • libjpeg-turbo-main\jmorecfg.h
  • libjpeg-turbo-main\jpeglib.h

(2) In file nana/include/nana/config.hpp, I uncommented the line //#define NANA_ENABLE_JPEG //!

(3) In file nana/source/paint/detail/image_jpeg.hpp, I replaced the line:

#include <nana_extrlib/jpeglib.h>

with the line:

#include "../../../extrlib/jpeglib.h"

(4) I built the library.

And of course, once you have built Nana with Jpeg support, your projects will have to link to the libjpeg static library (I named my lib files jpeg_Release_x64.lib and jpeg_Debug_x64.lib). Let me know if you have any questions.

I just compiled Nana (branch `develop-1.8`) with Jpeg support, on Windows with VC2019. I didn't use the original `libjpeg` library, instead I found a newer version on GitHub: https://github.com/libjpeg-turbo/libjpeg-turbo (I built it very easily using Visual Studio's innate support for CMake). After that, I did the following: (1) I copied the following files to `nana\extrlib`: - `libjpeg-turbo-main\out\build\x64-Debug\jconfig.h` - `libjpeg-turbo-main\jmorecfg.h` - `libjpeg-turbo-main\jpeglib.h` (2) In file `nana/include/nana/config.hpp`, I uncommented the line `//#define NANA_ENABLE_JPEG //!` (3) In file `nana/source/paint/detail/image_jpeg.hpp`, I replaced the line: ```` #include <nana_extrlib/jpeglib.h> ```` with the line: ```` #include "../../../extrlib/jpeglib.h" ```` (4) I built the library. And of course, once you have built Nana with Jpeg support, your projects will have to link to the libjpeg static library (I named my lib files `jpeg_Release_x64.lib` and `jpeg_Debug_x64.lib`). Let me know if you have any questions.

Thank you very much. Ver clear and detailed explanation.
I have no access to the nana-develop-1.8 so I have done all the steps with my 1.7.4 and got the jpeg-turbo-lib.

All integration has gone well, but the JPEG files do not get open. I guess that I am getting the same problem I got with the PNG files intergration. For the PNG, the png library declared in NANA has to be the same version you use for the png library. In my case, the NANA 1.7.4 expects to use the pnglib 1.5.8, but the one I got fom the web was 1.6.34. Version do not match and PNGs didn´t get open. It took me a lot of hours and debugging and I did not find the way to declare 1.6.34 pnglib on NANA. I did something dirty and tricky to get the PNGs working.

Working with the JPEGs they do not get open, and my first steps trying to debug the problem drive me to the same issue of version missmatching.

Brgds

Thank you very much. Ver clear and detailed explanation. I have no access to the nana-develop-1.8 so I have done all the steps with my 1.7.4 and got the jpeg-turbo-lib. All integration has gone well, but the JPEG files do not get open. I guess that I am getting the same problem I got with the PNG files intergration. For the PNG, the png library declared in NANA has to be the same version you use for the png library. In my case, the NANA 1.7.4 expects to use the pnglib 1.5.8, but the one I got fom the web was 1.6.34. Version do not match and PNGs didn´t get open. It took me a lot of hours and debugging and I did not find the way to declare 1.6.34 pnglib on NANA. I did something dirty and tricky to get the PNGs working. Working with the JPEGs they do not get open, and my first steps trying to debug the problem drive me to the same issue of version missmatching. Brgds

I've built 1.7.4 now, and everything works perfectly for me. The test program opened a .jpg file successfully, and displayed it in a nana::form.

I've built 1.7.4 now, and everything works perfectly for me. The test program opened a .jpg file successfully, and displayed it in a `nana::form`.
edited Jun 22 '21 at 12:17 am

Hi Error,

Many thanks for your support and testing.

I have repeated all the buiding again and it works now. I couldn´t find what was wrong first time.

I do apologize for the inconveniences.

Brgds

Hi Error, Many thanks for your support and testing. I have repeated all the buiding again and it works now. I couldn´t find what was wrong first time. I do apologize for the inconveniences. Brgds
159
views
4
replies
2
followers
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft