Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Windows #1

Open
Razdeep opened this issue Oct 3, 2020 · 7 comments
Open

Add support for Windows #1

Razdeep opened this issue Oct 3, 2020 · 7 comments
Labels
enhancement New feature or request hacktoberfest

Comments

@Razdeep
Copy link
Owner

Razdeep commented Oct 3, 2020

Splitwebp works fine for mac and linux.
Support for windows is yet to be added.

@Razdeep Razdeep added enhancement New feature or request hacktoberfest labels Oct 3, 2020
@oktak
Copy link

oktak commented Oct 7, 2020

Hi! I would like to try this. But it is a challenging on Windows. I am using:

Win10 (x64)
VS Community 2017 (15)
Cmake 3.18.3
OpenCV 3.4.11
libwebp-1.1.0-windows-x64.zip  

I can successfully compile (I guess my deliverable for this issue would be a README, loads of un-scriptable steps involved 🙄 ) into a splitwebp.exe. But when I try to passing a webp file to run it, it has no output files, and also shows no error message on the CMD.

I tried these animated webp files:

  1. https://mathiasbynens.be/demo/animated-webp
  2. http://littlesvr.ca/apng/gif_apng_webp2.html
  3. https://ezgif.com/webp-maker/ezgif-6-53fa07a0-webp

So, I started to debug mode. I modified main.cpp and hard code a image path on disk.

It shows an Exception: Access violation reading location. In fact, in current_frame_iter can parse the correct details about the webp file. Only the fragment.bytes and fragment.size property got wrong.
002

I tried all webp files above. Then I tried to edit this line if (WebPDemuxGetFrame(demux, 1, &current_frame_iter)) {
I changed it to if (WebPDemuxGetFrame(demux, 2, &current_frame_iter)) {

Then it no longer popup a Exception, but current_decoded_frame become NULL pointer and it return in line 103.

I did not tried to compile on Linux or Mac. (But I learnt that a user has successfully compiled on Linux in Issue #3 discussion)
To summarize the issues I face, could you help:

  1. Specify the library dependencies version, so that we could follow that,
  2. Offer some animated webp files for testing purpose?

Thanks!

@Razdeep
Copy link
Owner Author

Razdeep commented Oct 7, 2020

Hi! Could you try on this animation?
https://splitwebp.s3-eu-west-1.amazonaws.com/angry.webp

@Razdeep
Copy link
Owner Author

Razdeep commented Oct 7, 2020

@oktak you can add the steps for building in windows in the README

@oktak
Copy link

oktak commented Oct 10, 2020

I've added the steps for building in windows. I put it in a separated file because it is quite long.

I also tried the animation you mentioned. It still give the same Exception: Access violation reading location. I am still figuring out what happens. Is it related to pthread? It seems Windows does not have pthread, so it remove it in the CMakeLists.txt . Please let me know if it is a must.

@Razdeep
Copy link
Owner Author

Razdeep commented Oct 10, 2020

pthread was a dependency on libwebp in Linux.
I was getting an error, without linking it.
It might be possible that missing pthread is causing the problem.
I'm not sure about this. I haven't tried it on windows yet.

@oktak
Copy link

oktak commented Oct 10, 2020

I see. I find that vcpkg which is Microsoft's product to help mange packages for Visual Studio. I find people us it to install pthread for windows and also libwebp.

After some configuration, the Exception: Access violation now goes deeper, it locates at WebP.dll
image

I try to explore on that.

@oktak
Copy link

oktak commented Oct 11, 2020

Thank you for your review on my Pull Request. Sorry for my typo mistakes.

Updates:
I found it is probably the problem of include files of webp (decode.h, demux.h, ...etc).
It looks the the include files are in around version libwebp-0.4.1-windows-x64, but the version I tried before is libwebp-1.1.0-windows-x64

When I set the linker to use the include folder using the one of vcpkg, it can now produce the images of each frame.
(though the filenames are a bit long 😬 Updates: Oh! Just found if I use the "Release" config, it will be start from 1, without leading zeros.)
image

I'll update the README on both your suggestions and adjust the steps on building on Windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request hacktoberfest
Projects
None yet
Development

No branches or pull requests

2 participants