sylikc / jpegview

Fork of JPEGView by David Kleiner - fast and highly configurable viewer/editor for JPEG, BMP, PNG, WEBP, TGA, GIF and TIFF images with a minimal GUI. Basic on-the-fly image processing is provided - allowing adjusting typical parameters as sharpness, color balance, rotation, perspective, contrast and local under-/overexposure.
Other
2.05k stars 120 forks source link

Windows XP support is broken #51

Closed VisualKei closed 1 year ago

VisualKei commented 2 years ago

I can imagine it's odd to complain about this outdated OS, but such a lightweight image viewer is particularly useful on an old and weak machine not worth upgrading. And you still declare the compatibility with XP SP3, so there are 2 problems here:

  1. The Min Windows Version of .exe & .dlls is set to 6.0 and not to 5.1 as for XP, so the program doesn't even start.
  2. The webp.dll links to 4 functions in kernel32.dll that are absent in XP. Dependancy Walker mentions InitializeConditionVariable(), InitializeCriticalSectionEx(), SleepConditionVariableCS() and WakeConditionVariable(). Other files are OK.

I hope it won't be difficult to fix this, so please can you do it.

sylikc commented 2 years ago

Thanks for the catch.

I stopped having a real XP box to test on for years... I think the easiest fix is unfortunately to change the documentation to drop the support.

I can go fire up an old VM and figure out which was the last version which did have support and change the documentation to reflect that.

Unfortunately, moving forward, I can't really guarantee support on such and old OS. webp.dll hasn't really been changed in awhile, so I would have to guess XP support ended awhile back.

VisualKei commented 2 years ago

The last version that worked was David's 1.0.37. I think that the easiest thing you can do is to configure your Visual Studio compilation to target Win5.1 so that the program could at least start up. The WebP support isn't so important anyway, but even that is possible: there exists a completely fixed version based on your 1.0.39.1 that works fine even after replacing all dlls with yours targeted at Win6.0 (though I didn't check the webp support proper). I stumbled upon it on a certain forum and I don't know who's the author and how exactly did he fixed the webp.dll, but I will ask the uploader and try to find this out and maybe even invite that person to collaborate.

sylikc commented 2 years ago

Ok. Let me try those suggestions and do a little research on whether changing targetting has other side effects. If anything, I can always just make a separate XP build or something...

Yeah if you can point me to the forum or have that person come collaborate, I'm all ears.

sylikc commented 2 years ago

Out of curiosity, does the WiX installer work on XP?

sylikc commented 2 years ago

I think that the easiest thing you can do is to configure your Visual Studio compilation to target Win5.1 so that the program could at least start up.

I have some bad news... so I read about targeting, and (from Configuring Programs for Windows XP):

The toolset supplied in Visual Studio 2019 and later doesn't include support for creating code for Windows XP. Support for Windows XP development is available by using the Visual Studio 2017 v141_xp toolset. You can install the v141_xp toolset as an individual component option in the Visual Studio Installer.

sylikc commented 2 years ago

I just installed VS 2017, and I'll be looking into XP testing... give me a bit of time to set up the environment and do some additional testing

tumagonx commented 1 year ago

I used to built jpegview.exe linked to webp/wic/etc loaders dll statically and linked to actual image codec dll dynamically so I have:

jpegview.exe | |-- libwebp.dll |-- libjpeg.dll |-- libpng.dll |-- libjxl.dll

This way user could update codec dll separately, and give freedom to users to use any compiler for codec (since all image codec except openexr using C-API interface), e.g GCC which through its pthread emulation will easily fixed those webp nt6 threadingapi issues.

tumagonx commented 1 year ago

oh isn't pthread-win32 project compatible with Visualstudio?

tumagonx commented 1 year ago

or just dont use threads, and everyone happy lol WEBP_USE_THREAD

sylikc commented 1 year ago

I just tried building in VS2017... error linking, likely because the LIB files it's linking against are built from VS2019. I don't have the bandwidth for this at the moment...

if @tumagonx or someone else can try rebuilding all the libraries with VS2017 (have fun, I put some build instructions recently for JXL, but the others are pretty straightforward) and see if the project builds that'd be great!

tumagonx commented 1 year ago

ThinPC - Microsoft Virtual PC 2007

I rolled up my VPC2007 to run Windows7 and run VS2017 I try to do your way (loader as dll and Webp as static lib) but I cant complete the build because one of your libs is made with vs2019(i think)? linker complain version mismatch

so I can only provide this webp 1.3.0rc build without threads support, but version 1.3.0 ask libsharpyuv see screenshot.

basically build webp through cmake by adding -DWEBP_USE_THREAD=OFF

Do you want my webp build or you want try it yourself?

tumagonx commented 1 year ago

are you still plan to support XP though? I want to do full rebuild the libs but I'm more customised with GCC than vs, my way to this were mixing jpegview.exe with gcc build image codec dlls.

tumagonx commented 1 year ago

webpnothreads.docx in case OP need the webp.dll (rename to .docx to .7z)

sylikc commented 1 year ago

are you still plan to support XP though? I want to do full rebuild the libs but I'm more customised with GCC than vs, my way to this were mixing jpegview.exe with gcc build image codec dlls.

I don't know lol. I loved XP at one point, but I haven't ran an XP machine for probably almost 10 years. I wouldn't mind just dropping support for it. XP support is low-priority for JPEGView imho.

There's other higher priority issues like INI, translations, KeyMap and which are much more important. I wouldn't spend much time doing the building of the libraries for XP 😅.

tumagonx commented 1 year ago

that's fine if you drop it, XP diehards are content being self-supported. no problem :)

sylikc commented 1 year ago

@VisualKei I have gotten a build that works with XP. Can you test to make sure this is what you expect?

This will track the latest version, just without the aPNG/JXL/HEIC format support.

JPEGView-dev-TestRelease-WinXP.zip

This is a test release that currently tracks with HEAD code on master. It's a pre-release, but if it checks out, I'll make these custom releases with each formal release.

tumagonx commented 1 year ago

works great for me, thanks!

sylikc commented 1 year ago

cool. Alright let me know if there are any more problems, I'll make this a regular release.

Though, since it doesn't have any new format support, I'll only make releases if there's some other main program changes, like the keymap refactor #127