-
Notifications
You must be signed in to change notification settings - Fork 10
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
Possible to get static binaries? #1
Comments
I was thinking it would be a good idea to host some, so yes I'd like to do this. But in the mean time, what happens when you try to build with libjpeg support? Could you post the output of ./configure and your distro/version? |
Binaries would be awesome, thanks! Here's output from my Debian 8.8 Jessie AMD64 of configure:
So JPEG and PNG libraries are found. Now output from make:
Seems OK to me. And now when I try to analyze a JPEG image: |
Thanks, this was actually just a dumb bug in the fallback filetype detection. If you pull and rebuilt it should work. |
I tried to compile it with Cygwin for Windows and while it compiles fine and does "-version":
it doesn't want to work even on PNG images:
Output from configure from Cygwin:
And from make:
If you ever consider to make a Windows build perhaps this will be helpful. Anyway- thanks for a nice tool! |
I grabbed new code and it works great under Debian 8.8 with JPEGs! Great job! Thank you! |
Good to hear, I'll leave this open while I investigate setting up cross platform builds. The code should all be standard C, so building for Windows natively with mingw or clang rather than cygwin should be possible. But I haven't tested this in a long time. |
Digital Mars C Compiler for Windows says:
|
Oh yeah, this is used in the tools for command line option parsing. I was thinking more about the library code. But I'll look into it. There isn't anything inherently platform dependent about the project. |
I think I am quite close to compile it on Debian for Win32:
|
Hi, just wondering if there's still plans for cross platform support and static binaries? |
@BradleyDS2 I was able to compile without issue using MSYS2. The caveat is that this is linked with msys-2.0.dll and so msys will need to be installed (or at least this dll) to run it. This was built using the following config.mak
This can be reproduced using the existing build script simply by installing msys2, then using the included package manager to install gcc, make, and pkg-config (libjpeg and libpng aren't included and need to be compiled separately.) Builds within the vanilla mingw environment (no msys-2.0.dll dependency) succeed but seem to have issues with read failures within libjpeg/libpng which I haven't yet found an explanation for. I haven't attempted to port to VS/cl.exe |
Awesome! Are there any plans to add prebuilt binaries to the releases page in future? |
Sure, I'll revisit setting up non-msys dependent builds and add an official releases based on that going forward. I haven't made it a priority since activity on this ticket died down, so it's helpful for me to know that there's a real need for this. Thanks! |
That's awesome, thanks a lot! There's no need for you to thank me though, I wasn't sure if I'd even get a response, so I'm really grateful to you for responding and doing all of this. |
Hi, I second this idea! It will be so much help if you could put the stable binaries under the release tag. It is such a great tool! |
Sorry for the lack of updates here, shortly after the last activity on this ticket my Windows machine was rendered unusable in a flood, effectively putting this on hold. I looked into the alternatives (mingw cross compilation, the auto-expiring dev VMs from Microsoft, just buying another license) but nothing was particularly attractive. I'll have to repair the machine eventually, so I'll update once that happens or a better alternative crops up. |
Hi all I already install libpng and libjpeg on my system(Ubuntu 16.04). However when I run resdet test.png it got the errors as bellows :
Can you guys give me any advises. |
@0x09 say:
Interestingly, and under ReactOS (https://reactos.org/), you can compile programs for Windows? |
@rogerallen741 say:
Try to test. In: Lines 119 to 126 in 20926fb
put another error from: Lines 32 to 37 in 20926fb
example: return RDENOMEM; |
Hi @rogerallen741, can you post your config.mak and the image file?
|
Hi @zvezdochiot i replaced the RDEINVAL and built again. Also test with same image(test.png), while it output the same results: Invalid image lol... |
Hi @0x09 here is the config.mak
Here is the testing image(test.png) I also convert test.png to test.pgm by imagemagick. Here is the results:
|
@rogerallen741 say:
A I was hoping so. So still reading the image. To be sure, check a similar replacement in: Lines 78 to 82 in 2d870af
and test. And add before printf("Mime: %s", c); |
Ah, this is linking with libpng 1.2 whereas resdet really only targets the current release of 1.6. The configure script definitely should be changed to take this into consideration before treating libpng as "enabled" as it did here. I'm able to process this successfully on debian using libpng16. The pgm issue is separate and was fun to track down as it differs by OS/libc, but that's now fixed in 21e2148 -- thanks for finding this. |
@0x09 say:
$ ldd /usr/bin/resdet
linux-gate.so.1 => (0xb76f2000)
libresdet.so.0 => /usr/lib/i386-linux-gnu/libresdet.so.0 (0xb76a4000)
libjpeg.so.8 => /usr/lib/i386-linux-gnu/libjpeg.so.8 (0xb766b000)
libmagic.so.1 => /usr/lib/i386-linux-gnu/libmagic.so.1 (0xb764a000)
libm.so.6 => /lib/i386-linux-gnu/i686/cmov/libm.so.6 (0xb7624000)
libfftw3f.so.3 => /usr/lib/i386-linux-gnu/libfftw3f.so.3 (0xb7427000)
libpng12.so.0 => /lib/i386-linux-gnu/libpng12.so.0 (0xb73fd000)
libMagickWand.so.5 => /usr/lib/i386-linux-gnu/libMagickWand.so.5 (0xb72e0000)
libMagickCore.so.5 => /usr/lib/i386-linux-gnu/libMagickCore.so.5 (0xb7018000)
... Everything works. Maybe because of imagemagick? |
@0x09 say:
Maybe you should take a closer look at |
@0x09: @zvezdochiot:
After i remove the printf(), the code also can work properly. |
@rogerallen741 say:
Not instead, but beside. There are many things that depend on libpng 1.2 on the system. |
@zvezdochiot thanks for the link, that looks like a neat project. @rogerallen741 since you do have ImageMagick's libraries installed now you shouldn't actually need to install the newer version of libpng for this and may just want to disable it, since again ImageMagick supports that and far more formats. The libpng image reader is really only provided for instances where ImageMagick is not available. Also, if you have any further issues or just want to continue discussion please open a new github issue for this as we're potentially sending quite a lot of notifications to folks who were only watching this one for static binary support. |
@rogerallen741 say:
Seems understand. Replace: Lines 25 to 30 in 21e2148
on the: typedef enum RDError {
RDEOK = 0,
RDENOMEM,
RDEINTERNAL,
RDEINVAL,
RDENONE
} RDError; and return RDEINVAL to: Lines 78 to 82 in 2d870af
|
I installed libpng and libjpeg on my system. Compiled resdet but it still doesn't work with jpegs. Would it be possible for you to provide static binary for Linux? (Or maybe even for Windows?)
The text was updated successfully, but these errors were encountered: