pngcrush 1.8.13 not building in Windows 11
In pkgsrc, we just remove the call completely: --- pngcrush.c.orig 2024-02-01 09:09:19.207140753 +0000 +++ pngcrush.c @@ -5520,8 +5520,6 @@ int main(int argc, char *argv[]) * they were already checked in the pngcrush_measure_idat * function */ - png_set_option(read_ptr, PNG_IGNORE_ADLER32, - PNG_OPTION_ON); png_set_crc_action(read_ptr, PNG_CRC_QUIET_USE, PNG_CRC_QUIET_USE); }
There’s a PR on GitHub with a fix (though it’s closed and not applied because the contributor deleted their fork): https://github.com/glennrp/pmt/pull/2
That should have been 'pngcrush 1.8.13 does not build against png 1.6.42' in the subject, sorry.
png 1.8.13 does not build against png 1.6.42
increases file-size
Add man page
In Linux etc. pngcrush can already output to /dev/stdout as the outfile.png ; it can even load /dev/stdin as the infile.png the first time it attempts to do so; the problem is that pngcrush attempts to load the same infile.png more than once, which fails when infile.png was streamed in from the previous process as /dev/stdin. A hack for Linux etc. would be in the source code to look for if the inname variable equals "/dev/stdin", write the stream to something like temp.png, then update the value...
In Linux etc. pngcrush can already output to /dev/stdout as the outfile.png ; it can even load /dev/stdin as the infile.png the first time it attempts to do so; the problem is that pngcrush attempts to load the same infile.png more than once, which fails when infile.png was streamed in from the previous process as /dev/stdin. A hack for Linux etc. would be in the source code to look for if the inname variable in equals "/dev/stdin", write the stream to something like temp.png, then update the value...
-fix does not work as documented
Correction. The command to run: pngcrush -q -rem allb -reduce src.png pngout.png attached
pngout.png attached
pngcrush corrupts the image
tool: pngcrush
oldtimeout with overwrite
[pngcrush] Revise "-force/-noforce" documentation
[pngcrush] Fix documentation about "-noforce"; fix "-bail" behaviour
[Pngcrush] Update pngcrush to 1.8.14 and libpng to libpng-1.6.34
[pngcrush] Version 1.8.13 (built with libpng-1.6.32 and zlib-1.2.11)
There is no clock_gettime on macOS prior to 10.12.
There's no problem with MacOS 10 on pngcrush. It's the problem of finding clock_gettime on older versions. Apparently ImageMagick's scheme finds it but simply adding librt to LIBS doesn't do it for pngcrush. Incidentally libpng has the same problem. I think you will find that on MacOS 10, the "timepng" tool gets built but on the older Macs it will be omitted.
clock_gettime(3) is found in libc (/usr/lib/system/libsystem_c.dylib) on macOS 10.12+. There's no seperate librt. AC_SEARCH_LIBS(clock_gettime, rt, ...) does not guarantee librt is present. It only attempts to link against librt if clock_gettime isn't available when linking aginast no extra libraries; but since it's already in libc, the -lrt step is simply skipped.
Well, that indicates that -lrt should work. ImageMagick's configure.ac is heavy reading, but somehow it's finding librt. It uses autoconf Check for clock_gettime(). AC_SEARCH_LIBS(clock_gettime, rt, AC_DEFINE([HAVE_CLOCK_GETTIME,[1],[Define to 1 if you have clock_gettime.]) AC_MSG_CHECKING([whether clock_gettime supports CLOCK_REALTIME]) AC_COMPILE_IFELSE( AC_LANG_PROGRAM( [[#include <time.h>]], [[clockid_t clockType = CLOCK_REALTIME;]]), AC_MSG_RESULT(yes) AC_DEFINE([HAVE_CLOCK_REALTIME,[1], [Define...
Well, that indicates that -lrt should work. ImageMagick's configure.ac is heavy reading, but somehow it's finding librt. It uses autoconf Check for clock_gettime(). AC_SEARCH_LIBS(clock_gettime, rt, AC_DEFINE([HAVE_CLOCK_GETTIME,[1],[Define to 1 if you have clock_gettime.]) AC_MSG_CHECKING([whether clock_gettime supports CLOCK_REALTIME]) AC_COMPILE_IFELSE( AC_LANG_PROGRAM( [[#include <time.h>]], [[clockid_t clockType = CLOCK_REALTIME;]]), AC_MSG_RESULT(yes) AC_DEFINE([HAVE_CLOCK_REALTIME,[1], [Define...
bash-3.2$ grep GETTIME config/config.h /* #undef HAVE_CLOCK_GETTIME */ #define HAVE_GETTIMEOFDAY 1 bash-3.2$
Would you configure ImageMagick on your platform and do grep GETTIME config/config.h
No, unfortunately, that just leads to ld: library not found for -lrt.
On some platforms it is sufficient to enable "LIBS += -lrt" in the Makefile. Does that work on the MacOS/XCode versions that are having trouble? I believe that would be a better solution if it works because it will give you the high-resolution timing.
OS X 10.11 with Xcode 8.x clock_gettime problem
Fixed in the GIT repos. Just add "exit (0);" around line 4478 in pngcrush.c until I push 1.8.13 out soon with the fix. The "CPU time" line will not appear.
Fixed in the GIT repos. Just add "exit (0);" around line 4478 in pngcrush.c until I push 1.8.13 out soon with the fix.
Add "exit(0)" after processing the "-version" argument (thanks to Peter Hagan).
Ah, thanks. I'll take care of it soon. Glenn
...no? :) I may not have made it clear that I'm talking about "pngcrush -version".
Did you add the "Check ..for the most recent version" yourself, then? It isn't coming from the pngcrush that I'm distributing.
I've used the versions from here (https://sourceforge.net/projects/pmt/files/pngcrush/).
pngcrush -version behavior different in 1.8.12
You can try using "pngcrush -v ...." to get the same output (more or less) as pngcrush-1.8.11
Your pngcrush has been modified downstream. Where did you get it? (The pngcrush distributed from here does not say "Check http://pmt.sf.net for the most recent version.")
pngcrush -version behavior different in 1.8.12
pngcrush-1.8.12 released
[pngcrush] Update libpng to version 1.6.31
[pngcrush] add comments about how to get more verbose help
[pngcrush] Changed default verbosity from 1 (normal) to 0 (quiet). Use "-v"
[pngcrush] Added powerpc_init.c and filter_vsx_intrinsics.c
Thanks, I've reported this upstream and will patch pngcrush.
The resulting code is #ifdef Z_SOLO typedef __PTRDIFF_TYPE__ ptrdiff_t; /* guess -- will be caught if guess is wrong */ #endif
Hi Glenn one of SBo maintainer push this fix in the build script and it worked fine here sed -i '/typedef long ptrdiff_t;/s,long,__PTRDIFF_TYPE__,' zutil.h is it possible to change it in upstream code? thanks
Thanks again, that gives more to go on. That should be using the zutil.h that's included in the tar.xz distribution, so I wonder why you are seeing a conflict. Hmm, I see, it's conflicting with the system stddef.h which would be a zlib bug not a pngcrush bug. I'll follow up on that with the zlib dev.
Thanks again, that gives more to go on. That should be using the zlib.h that's included in the tar.xz distribution, so I wonder why you are seeing a conflict. Hmm, I see, it's conflicting with the system stddef.h which would be a zlib bug not a pngcrush bug. I'll follow up on that with the zlib dev.
Just FYI, i used this source: http://downloads.sourceforge.net/pmt/pngcrush-1.8.11.tar.xz some other distributions are using -nolib version
Thanks. I'll look into this.
I still got the same build failure message on zlib 1.2.11
Hi Glenn, I'm afraid that's quite complicated in my situation. zlib is part of Slackware core packages, while pngcrush came in as third party application from SBo project and we have a strict rule that it should build on top of Slackware's core package. Patrick (Slackware maintainer) is very strict on introducing new version on -stable releases, except for security updates. Since there has been no security vulns report on zlib, i don't really think he would accept this proposal. Also, same code works...
Pngcrush build error with ptrdiff_t when bulding with zlib-1.2.8
Please try building with zlib-1.2.11.
Plese try building with zlib-1.2.11.
No problem, I added one.
,Pngcrush build error with ptrdiff_t
Sorry, i forgot to put a title for this ticket
,