Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Remove the jpeglib.lib or replace with a header only?  (Read 3516 times)

0 Members and 1 Guest are viewing this topic.

WarlockD

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
Remove the jpeglib.lib or replace with a header only?
« on: August 04, 2016, 03:41:33 pm »
I was having some issues compiling sfml for x64 bit as a static lib in Visual studio.  I can handle figuring out how to do the library dependency but as I was looking though the code I noticed that the jpeglib library is used in only ONE spot.  Specifically writeJpg in ImageLoader.cpp.  The stbi package is used for everything else.

Don't get me wrong, I do want to be able to save in jpeg.  People should be given a choice.  I am just wondering why a header only library can be used.  (For example, TinyJPEG:https://github.com/serge-rgb/TinyJPEG that I used to replace it with)

Just a thought.  Was struggling with getting jpeglib to comple till I found somones sln online:P

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Remove the jpeglib.lib or replace with a header only?
« Reply #1 on: August 05, 2016, 01:27:58 am »
Since I've built all the SFML dependencies not so long ago I know that it can be a pain. Question is however, why did you build SFML's dependencies when we provide them all already?

Since you asked, here are the obvious question: The linked library is maybe a year old, while SFML is slightly older. libjpeg is used by thousands of applications and as such can be trusted enough to work on all kinds of hardware. Changing dependencies is something that shouldn't be done very often, since it will break people's build systems (missing libraries, linking unneeded libraries, etc). ;)

I don't know how well TinyJPEG has been tested and what its performance is, but generally I wouldn't mind switching away. I think for the VS universal builds I even used the JPEG Turbo code, since their build system works at least!
Would be interesting to hear the opinions of other team members.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

WarlockD

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
Re: Remove the jpeglib.lib or replace with a header only?
« Reply #2 on: August 07, 2016, 02:58:28 pm »
Your quite right of course.  There is nothing wrong with using jpeglib.  I was just was doing some google searches at the time and came across TinyJPEG and just got me thinking.  I was having problems using the already precompiled librarys on a x64 static build I was trying out and was trying to narrow down the dependency that had issues.  jpeglib being one of them:P